/**
 * DropSomewhere - Modern Console Design
 * Minimal, technical aesthetic with white color tone
 */

/* ====== RESET & BASE ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:        #ffffff;
    --bg-alt:    #f5f5f5;
    --bg-hover:  #eaeaea;
    --border:    #e0e0e0;
    --border-dark:#cccccc;
    --text:      #1a1a1a;
    --text-dim:  #757575;
    --text-bright:#ffffff;
    --accent:    #0066ff;
    --accent-hover:#0052cc;
    --accent-light:#e8f0fe;
    --success:   #00875a;
    --warning:   #ff991f;
    --danger:    #de350b;
    --mono:      'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    --sans:      -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    --radius:    6px;
    --shadow:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

@font-face {
    font-family: 'JetBrains Mono';
    src: local('JetBrains Mono'), local('SF Mono');
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== LAYOUT ====== */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ====== NAVBAR ====== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-brand span {
    color: var(--accent);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.navbar-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.navbar-links a:hover {
    color: var(--text);
}

/* ====== HERO ====== */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-logo {
    font-size: 3rem;
    margin-bottom: 24px;
}

.hero h1 {
    font-family: var(--mono);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -2px;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero h1 .accent {
    color: var(--accent);
}

.hero p {
    font-size: 1rem;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-image {
    margin: 48px auto 0;
    max-width: 600px;
    width: 100%;
}

.hero-image img, .hero-image svg {
    width: 100%;
    height: auto;
}

/* ====== BUTTONS ====== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    background: var(--bg);
    color: var(--text);
}

.btn:hover {
    background: var(--bg-alt);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--accent);
    color: var(--text-bright);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* ====== SECTIONS ====== */
.section {
    padding: 64px 0;
    border-top: 1px solid var(--border);
}

.section-alt {
    background: var(--bg-alt);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ====== FEATURES GRID ====== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-dark);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
}

.feature-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ====== HOW TO USE ====== */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    counter-reset: step;
}

.step {
    padding: 32px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    position: relative;
    counter-increment: step;
}

.step::before {
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: var(--text-bright);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 16px;
}

.step h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.step p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ====== CODE BLOCK ====== */
.code-block {
    background: #1a1a1a;
    color: #e0e0e0;
    border-radius: var(--radius);
    padding: 20px 24px;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
    position: relative;
    margin: 16px 0;
}

.code-block .comment {
    color: #6a9955;
}

.code-block .keyword {
    color: #569cd6;
}

.code-block .string {
    color: #ce9178;
}

.code-block .function {
    color: #dcdcaa;
}

.code-block .prompt {
    color: #6a9955;
    user-select: none;
}

.code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.code-copy {
    background: none;
    border: 1px solid #444;
    color: #999;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    font-family: var(--mono);
    transition: all 0.2s;
}

.code-copy:hover {
    border-color: #888;
    color: #ccc;
}

/* ====== DOWNLOADS SECTION ====== */
.download-banner {
    text-align: center;
    padding: 80px 0 40px;
}

.download-banner .tag {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.download-banner h2 {
    font-family: var(--mono);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 12px;
}

.download-banner p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Auto-detect bar */
.auto-detect-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    margin: 24px auto;
    max-width: 700px;
    font-size: 0.85rem;
}

.auto-detect-bar .detected {
    font-weight: 700;
    color: var(--accent);
}

.auto-detect-bar .btn {
    padding: 6px 16px;
    font-size: 0.8rem;
    margin-left: auto;
}

/* Version selector */
.version-selector {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 32px 0 24px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 4px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.version-btn {
    padding: 8px 20px;
    border: none;
    background: none;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.version-btn:hover {
    color: var(--text);
}

.version-btn.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow);
}

.version-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
}

.version-badge.stable { background: #e6f7ed; color: #00875a; }
.version-badge.latest { background: var(--accent-light); color: var(--accent); }
.version-badge.nightly { background: #fff3e0; color: #e65100; }

/* OS Sections */
.os-section {
    margin-bottom: 40px;
}

.os-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.os-section-header .os-icon {
    width: 32px;
    height: 32px;
}

.os-section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.os-section-header .detected-tag {
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    display: none;
}

.os-section-header .detected-tag.show {
    display: inline-block;
}

/* Download table */
.download-table {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}

.download-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 80px;
    padding: 10px 16px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.download-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 80px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    align-items: center;
    transition: background 0.15s;
}

.download-row:last-child {
    border-bottom: none;
}

.download-row:hover {
    background: var(--bg-alt);
}

.download-row .filename {
    font-weight: 600;
    font-family: var(--mono);
}

.download-row .arch {
    color: var(--text-dim);
    font-size: 0.78rem;
}

.download-row .size {
    color: var(--text-dim);
    font-size: 0.78rem;
}

.download-row .format {
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--bg-alt);
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
    text-align: center;
}

.download-row .download-btn {
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background 0.2s;
}

.download-row .download-btn:hover {
    background: var(--accent-hover);
}

/* Quick install */
.quick-install {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 24px;
    margin: 32px 0;
    text-align: center;
}

.quick-install p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

/* ====== FOOTER ====== */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer .mt-1 {
    margin-top: 8px;
}

/* ====== TRANSFER UI (Web App Section) ====== */
.transfer-section {
    max-width: 600px;
    margin: 0 auto;
}

.transfer-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dim);
}

/* ====== DROP ZONE ====== */
.drop-zone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-alt);
}

.drop-zone:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.drop-zone p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* ====== FILE LIST ====== */
#send-file-list {
    margin: 16px 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--bg-alt);
}

.file-item .file-icon {
    font-size: 1.2rem;
}

.file-item .file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-item .file-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.file-item .file-size {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.file-item .file-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.file-item .file-remove:hover {
    background: rgba(222, 53, 11, 0.1);
}

/* ====== MULTI-RECEIVER OPTION ====== */
.multi-receiver-option {
    margin: 16px 0;
    padding: 12px;
    background: var(--bg-alt);
    border-radius: var(--radius);
}

.multi-receiver-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.multi-receiver-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.multi-receiver-option .hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
    margin-left: 26px;
}

/* ====== BUTTONS ====== */
button {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 24px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

button:hover:not(:disabled) {
    background: var(--bg-hover);
    box-shadow: var(--shadow);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.btn-primary {
    background: var(--accent);
    color: var(--text-bright);
    border-color: var(--accent);
}

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

#send-btn {
    width: 100%;
    margin-top: 16px;
}

/* ====== INPUTS ====== */
input[type="text"] {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 8px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

/* ====== STATUS SECTION ====== */
#status {
    text-align: center;
    display: none;
}

#status:not(.hidden) {
    display: block;
}

#status h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

#status-message {
    color: var(--text-dim);
    margin-bottom: 24px;
}

/* ====== CODE DISPLAY ====== */
#code-display {
    background: var(--bg-alt);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: none;
}

#code-display:not(.hidden) {
    display: block;
}

#pairing-code {
    display: inline-block;
    background: var(--accent);
    color: var(--text-bright);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 6px;
    margin-top: 8px;
}

.expiry-timer {
    font-size: 1rem;
    color: var(--warning);
    margin-top: 12px;
    font-weight: 600;
}

.expiry-timer.expired {
    color: var(--danger);
}

.receiver-count {
    font-size: 0.9rem;
    color: var(--success);
    margin-top: 8px;
    font-weight: 500;
}

/* ====== PROGRESS ====== */
#progress-container {
    margin: 24px 0;
    display: none;
}

#progress-container:not(.hidden) {
    display: block;
}

.progress-bar-wrapper {
    width: 100%;
    height: 20px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: var(--success);
    border-radius: var(--radius);
    transition: width 0.3s ease;
}

#progress-text {
    display: block;
    margin-top: 8px;
    font-weight: 600;
}

/* ====== SENDER FILE PROGRESS ====== */
#sender-progress-container {
    margin: 24px 0;
    text-align: left;
    display: none;
}

#sender-progress-container:not(.hidden) {
    display: block;
}

#sender-progress-container h4 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-dim);
}

.sender-file-progress {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-alt);
    border-radius: var(--radius);
}

.sender-file-progress .file-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sender-file-progress .progress-bar-container {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.sender-file-progress .progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.sender-file-progress .progress-text {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
    text-align: right;
}

.sender-file-progress.completed .progress-bar-fill {
    background: var(--success);
}

/* ====== RECEIVER FILE LIST ====== */
#receiver-file-list-container {
    margin: 24px 0;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

#receiver-file-list-container:not(.hidden) {
    display: block;
}

#receiver-file-list-container h4 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-dim);
}

.received-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--bg-alt);
}

.received-file-item .file-icon {
    font-size: 1.5rem;
}

.received-file-item .file-info {
    flex: 1;
}

.received-file-item .file-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.received-file-item .file-size {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.received-file-item .file-status {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

/* ====== ACTION BUTTONS ====== */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

#cancel-btn,
#send-more-btn {
    display: none;
}

#cancel-btn:not(.hidden),
#send-more-btn:not(.hidden) {
    display: inline-block;
}

#send-more-btn {
    background: var(--success);
    color: var(--text-bright);
    border-color: var(--success);
}

#send-more-btn:hover {
    background: #006d46;
}

/* ====== UTILITY CLASSES ====== */
.hidden {
    display: none !important;
}

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

/* ====== ANIMATIONS ====== */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .download-table-header,
    .download-row {
        grid-template-columns: 1fr 1fr;
        gap: 4px 12px;
    }

    .download-table-header .arch,
    .download-table-header .size,
    .download-table-header .format {
        display: none;
    }

    .download-row .arch,
    .download-row .size,
    .download-row .format {
        display: none;
    }

    .navbar-links {
        display: none;
    }

    input[type="text"] {
        font-size: 1.2rem;
        letter-spacing: 4px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }
}

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

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .download-banner h2 {
        font-size: 1.6rem;
    }

    .auto-detect-bar {
        flex-wrap: wrap;
    }

    .auto-detect-bar .btn {
        margin-left: 0;
    }
}
