:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --warning: #f59e0b;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #475569;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -2px;
}

.tab-content {
    display: none;
}

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

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.drop-zone p {
    margin: 0.25rem 0;
}

.drop-zone .hint {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* File List */
.file-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.file-item .name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .size {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-left: 1rem;
}

.file-item .remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.25rem;
    margin-left: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

/* Input Group */
.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.code-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: monospace;
}

.code-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Room Code Display */
.room-code-display {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.room-code-display .label {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.code-text {
    font-size: 2rem;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 0.1em;
    margin: 1rem 0;
    color: var(--primary);
}

.room-code-display .hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Status Messages */
.status-message {
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-top: 1rem;
}

/* Connecting Screen */
.steps {
    margin: 2rem 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--text-muted);
}

.step.active {
    color: var(--primary);
}

.step.completed {
    color: var(--success);
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.step.active .step-icon {
    background: var(--primary);
    color: white;
}

.step.completed .step-icon {
    background: var(--success);
    color: white;
}

/* Transfer Screen */
.progress-container {
    margin: 1.5rem 0;
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.progress-text {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.file-progress-list {
    margin: 1.5rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.file-progress-item {
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.file-progress-item .name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-progress-item .details {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-progress-item .progress-bar {
    margin-top: 0.5rem;
}

.transfer-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Result Screen */
.result-icon {
    font-size: 4rem;
    text-align: center;
    margin: 1rem 0;
}

.result-icon.success {
    color: var(--success);
}

.result-icon.error {
    color: var(--danger);
}

.result-details {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.result-details p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    #app {
        padding: 1rem 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .code-text {
        font-size: 1.5rem;
    }

    .input-group {
        flex-direction: column;
    }
}
