/**
 * LocalSend Transfer - Styles
 * WebRTC peer-to-peer transfer
 */

/* Keep the application focused on file transfer. The informational banner remains in the markup for accessibility and can be restored without a template change. */
.localsend-top-banner {
    display: none;
}

body,
body.admin-bar {
    padding-top: 0;
}

/* Keep the page title available to crawlers and assistive tech without adding visual weight. */
h1.entry-title,
.post-title,
.entry-title,
h1.post-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 768px) {
    body,
    body.admin-bar {
        padding-top: 0;
    }
}

.localsend-container {
    max-width: 800px;
    margin: 10px auto 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #F5F6F8;
    border-radius: 16px;
}

.localsend-seo-summary {
    max-width: 800px;
    margin: 14px auto 0;
    padding: 0 20px 22px;
    color: #4f5b67;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.localsend-seo-summary h2 {
    margin: 0 0 8px;
    color: #263238;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.localsend-seo-summary p {
    margin: 0 0 8px;
}

.localsend-seo-summary p:last-child {
    margin-bottom: 0;
}

.localsend-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 24px 20px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.device-info-main {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.device-name {
    font-weight: 500;
    color: #333;
    font-size: 28px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.device-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    display: inline-block;
    flex-shrink: 0;
}

.device-status {
    display: none !important;
}

.connection-type {
    display: none !important;
}

.rename-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rename-input {
    font-size: 20px;
    font-weight: 600;
    color: #495057;
    background: rgba(0, 166, 153, 0.03);
    border: 1px solid rgba(0, 166, 153, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    width: auto;
    min-width: 150px;
    outline: none;
    transition: all 0.2s ease;
}

.rename-input:focus {
    background: #fff;
    border-color: #00A699;
    box-shadow: 0 0 0 3px rgba(0, 166, 153, 0.1);
}

.rename-type-label {
    font-size: 20px;
    font-weight: 500;
    color: #adb5bd;
    margin-right: 8px;
}

.btn-rename {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    background: #00A699;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 166, 153, 0.2);
}

.btn-rename:hover {
    background: #008B7F;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 166, 153, 0.3);
}

.btn-rename:active {
    transform: translateY(0);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Tabs - hidden (only one tab) */
.localsend-tabs {
    display: none !important;
}

.tab-btn {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
    color: #666;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.tab-btn:hover {
    color: #00A699;
    background: rgba(0, 166, 153, 0.05);
    transform: scale(1.02);
}

.tab-btn.active {
    color: #00A699;
    background: rgba(0, 166, 153, 0.1);
    font-weight: 500;
}

.tab-content {
    display: block;
    padding: 25px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-content.active {
    display: block;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.2px;
}

.btn-primary {
    background: #00A699;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 166, 153, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: #008B7F;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 166, 153, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #FFFFFF;
    color: #333;
    border: 1px solid #E0E0E0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #F5F6F8;
    border-color: #00A699;
    color: #00A699;
    transform: scale(1.05);
}

/* File list */
.file-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #FFFFFF;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.file-item:hover {
    background: #F5F6F8;
    border-color: #00A699;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 166, 153, 0.1);
}

.btn-refresh:hover {
    background: #00A699;
    color: #fff;
    border-color: #00A699;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 166, 153, 0.2);
}

.btn-refresh:disabled,
.btn-refresh.loading {
    opacity: 0.6;
    cursor: wait;
    background: rgba(0, 166, 153, 0.05) !important;
    color: #00A699 !important;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.file-item.received {
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.file-name {
    flex: 1;
    font-weight: 400;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    margin: 0 15px;
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

/* Device discovery */
.device-discovery {
    margin-bottom: 25px;
}

.device-discovery h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.discovery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.devices-list {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E0E0E0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    min-width: 200px;
    flex: 1 1 auto;
}

.device-item:hover {
    border-color: #00A699;
    background: rgba(0, 166, 153, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 166, 153, 0.15);
}

.device-item.selected {
    border-color: #00A699;
    background: rgba(0, 166, 153, 0.08);
    box-shadow: 0 4px 12px rgba(0, 166, 153, 0.2);
}

.device-icon {
    font-size: 32px;
    margin-right: 15px;
}

.device-details {
    flex: 1;
}

.device-details .device-name {
    font-weight: 400;
    color: #333;
    margin-bottom: 4px;
    display: block;
}

.device-type {
    font-size: 12px;
    color: #00A699;
    font-weight: 400;
}

.device-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.device-action-btn {
    appearance: none;
    border: 1px solid #00A699;
    background: #ffffff;
    color: #00A699;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.device-action-btn:hover,
.device-action-btn:focus {
    background: rgba(0, 166, 153, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 166, 153, 0.12);
    outline: none;
}

.device-file-btn {
    border-color: #0ea5e9;
    color: #0284c7;
}

.device-file-btn:hover,
.device-file-btn:focus {
    background: rgba(14, 165, 233, 0.08);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.text-message-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.38);
}

.text-message-modal.is-visible {
    display: flex;
}

.text-message-panel {
    width: min(520px, 100%);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
    padding: 22px;
}

.text-message-title {
    margin: 0 0 6px;
    color: #212529;
    font-size: 20px;
    font-weight: 600;
}

.text-message-subtitle {
    margin-bottom: 14px;
    color: #6c757d;
    font-size: 13px;
}

.text-message-input {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    padding: 12px;
    color: #212529;
    font: inherit;
    line-height: 1.5;
    outline: none;
}

.text-message-input:focus {
    border-color: #00A699;
    box-shadow: 0 0 0 3px rgba(0, 166, 153, 0.12);
}

.text-message-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.text-message-counter {
    color: #6c757d;
    font-size: 12px;
}

.text-message-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.text-message-btn {
    border: 1px solid #d7dee8;
    background: #ffffff;
    color: #495057;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.text-message-btn:hover,
.text-message-btn:focus {
    background: #f8fafc;
    outline: none;
}

.text-message-send-btn,
.text-message-copy-btn,
.text-message-reply-btn {
    border-color: #00A699;
    background: #00A699;
    color: #ffffff;
}

.text-message-send-btn:hover,
.text-message-send-btn:focus,
.text-message-copy-btn:hover,
.text-message-copy-btn:focus,
.text-message-reply-btn:hover,
.text-message-reply-btn:focus {
    background: #008f84;
}

.text-message-send-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.incoming-text-message-body {
    max-height: min(45vh, 320px);
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid #edf1f5;
    border-radius: 6px;
    background: #f8fafc;
    color: #212529;
    line-height: 1.55;
    padding: 12px;
    margin-bottom: 16px;
}

.no-devices {
    padding: 40px;
    text-align: center;
    color: #999;
    font-style: italic;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Transfer actions - hidden (auto-send on device click) */
.transfer-actions {
    display: none !important;
}

#send-files-btn,
#select-files-btn {
    display: none !important;
}

/* Progress bar */
.progress-container {
    margin-top: 20px;
    padding: 20px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #00A699;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    border-radius: 5px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

/* Receive toggle */
.receive-toggle-container {
    display: flex;
    justify-content: flex-end;
}

.receive-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 400;
    font-size: 15px;
    color: #333;
}

.receive-toggle-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #00A699;
    flex-shrink: 0;
    cursor: pointer;
}

.receive-toggle-label span {
    user-select: none;
    color: #333;
    font-size: 15px;
}

.receive-status {
    padding: 15px;
    background: #F5F6F8;
    border-radius: 8px;
    text-align: center;
    color: #666;
    margin-top: 15px;
    font-weight: 400;
}

.receive-status.active {
    background: rgba(0, 166, 153, 0.1);
    color: #00A699;
}

/* Incoming transfer */
.incoming-transfer {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(129, 199, 132, 0.1) 100%);
    border-radius: 10px;
    border: 2px solid #4caf50;
}

.incoming-transfer h3 {
    margin: 0 0 15px 0;
    color: #2e7d32;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.incoming-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

/* Received files */
.received-files {
    margin-top: 25px;
}

.received-files h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .localsend-container {
        padding: 15px;
        border-radius: 12px;
    }

    .localsend-header {
        padding: 20px 15px;
    }

    .device-info-main {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .device-name {
        font-size: 22px;
        width: 100%;
        text-align: center;
    }

    .device-status {
        width: 10px;
        height: 10px;
    }

    .connection-type {
        font-size: 12px;
        padding: 4px 10px;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .device-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .device-actions {
        width: 100%;
    }

    .device-action-btn {
        flex: 1 1 120px;
    }

    .text-message-panel {
        padding: 18px;
    }

    .text-message-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .text-message-actions {
        width: 100%;
    }

    .text-message-btn {
        flex: 1 1 auto;
    }

    .incoming-actions {
        flex-direction: column;
    }

    .incoming-actions .btn {
        width: 100%;
    }
}

/* Recent Transfers Unified History Section */
.recent-uploads {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 24px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: block;
    visibility: visible;
}

.recent-uploads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.recent-uploads-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #495057;
}

.recent-uploads-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.recent-uploads-select {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    color: #495057;
    background-color: #fff;
    cursor: pointer;
    outline: none;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
    border: 1px solid #dc3545;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.recent-uploads-table-container {
    overflow-x: auto;
}

.recent-uploads-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    border-radius: 8px;
    overflow: hidden;
}

.recent-uploads-table thead {
    background: #F8F9FA;
}

.recent-uploads-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    border-bottom: 2px solid #E9ECEF;
    white-space: nowrap;
}

.recent-uploads-table tbody tr {
    border-bottom: 1px solid #F0F0F0;
    transition: background-color 0.15s;
}

.recent-uploads-table tbody tr:hover {
    background-color: #F8F9FA;
}

.recent-uploads-table td {
    padding: 16px;
    color: #212529;
    vertical-align: middle;
}

.recent-transfers-empty td {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px !important;
}

.recent-transfers-direction {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.recent-transfers-direction.send {
    background: rgba(0, 166, 153, 0.1);
    color: #00A699;
}

.recent-transfers-direction.receive {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.recent-uploads-filename {
    color: #3b82f6;
    text-decoration: none;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    font-weight: 500;
}

.recent-uploads-datetime {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recent-uploads-date {
    color: #212529;
    font-size: 13px;
}

.recent-uploads-time {
    color: #6c757d;
    font-size: 11px;
}

.recent-uploads-speed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recent-uploads-speed-duration {
    color: #212529;
    font-size: 13px;
}

.recent-uploads-speed-value {
    color: #6c757d;
    font-size: 11px;
}

.recent-transfers-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-transfers-status.status-success {
    background: #e6fcf5;
    color: #0ca678;
    border: 1px solid #c3fae8;
}

.recent-transfers-status.status-failure {
    background: #fff5f5;
    color: #fa5252;
    border: 1px solid #ffe3e3;
}

/* Responsive */
@media (max-width: 768px) {
    .recent-uploads {
        padding: 16px;
        margin-top: 20px;
    }
    
    .recent-uploads-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .recent-uploads-header h3 {
        font-size: 18px;
    }
    
    .recent-uploads-table th,
    .recent-uploads-table td {
        padding: 10px;
    }
    
    .recent-uploads-filename {
        max-width: 120px;
    }
}

.align-right-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 15px;
}

.rename-label {
    font-size: 16px;
    font-weight: 500;
    color: #495057;
    margin-right: 12px;
    white-space: nowrap;
}

/* ===== Remote Transfer Button ===== */
.localsend-remote-hint {
    margin-top: 18px;
    text-align: center;
}

.localsend-remote-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 28px;
    background: #B2DFD8;
    color: #2E6B63;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(0, 166, 153, 0.15);
    transition: all 0.2s ease;
}

.remote-btn-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.localsend-remote-btn:hover {
    background: #8FD4CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 166, 153, 0.25);
}

.localsend-remote-btn:active {
    transform: translateY(0);
}

.localsend-remote-desc {
    margin: 8px 0 0;
    font-size: 12px;
    color: #90A4AE;
    text-align: center;
    line-height: 1.4;
}

.localsend-remote-desc-link {
    color: #607D8B;
    text-decoration: underline;
    font-weight: 500;
}

.localsend-remote-desc-link:hover {
    color: #00A699;
}
