:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --bg: #F4F6F9;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --success: #10B981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

header {
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.app-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.logo h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-main);
}

.subtitle {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
}

.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.hidden {
    display: none !important;
}

/* Dashboard Layout */
.container {
    width: 100%;
    max-width: 800px;
}

#dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.connection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-radius: 100px;
}

.device-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.transfer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .transfer-grid {
        grid-template-columns: 1fr;
    }
}

/* Pairing Section */
.display-card {
    background: var(--card-bg);
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
}

.display-card h2 {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 800;
}

.display-card p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.connection-hub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
}

#qrcode-container {
    background: white;
    padding: 24px;
    border-radius: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
}

.pairing-info {
    text-align: left;
}

.key-display .label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 8px;
}

.key-display .key {
    font-size: 36px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 6px;
    font-family: inherit;
}

@media (max-width: 600px) {
    .connection-hub {
        flex-direction: column;
        gap: 32px;
    }

    .pairing-info {
        text-align: center;
    }
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.connected {
    background: #DCFCE7;
    color: #166534;
}

.status-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 32px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #F8FAFC;
    transform: translateY(-2px);
}

.upload-icon-themed {
    color: var(--primary);
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 16px;
}

/* History & File List */
.history-card {
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.history-header {
    margin-bottom: 16px;
}

.history-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 400px;
}

.empty-state {
    color: var(--text-muted);
    font-size: 13px;
    margin: auto;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #F8FAFC;
    border: 1px solid var(--border);
}

.file-icon {
    font-size: 20px;
}

.file-data {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.file-data .name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-data .meta {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.file-status {
    font-size: 12px;
    font-weight: 700;
}

.file-status.pending {
    color: var(--text-muted);
}

.file-status.sending {
    color: var(--primary);
}

.file-status.done {
    color: var(--success);
}

/* Progress Mini */
.progress-mini {
    width: 100%;
    height: 4px;
    background: #E2E8F0;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-mini-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s;
}

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.secondary-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #F1F5F9;
    color: var(--text-main);
    border-color: var(--text-muted);
}

footer {
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 12px;
}