
/* CSS Reset and Root Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark theme color palette */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #7d8590;
    --text-muted: #484f58;
    --accent-primary: #1f6feb;
    --accent-secondary: #5b6677;
    --border-default: #30363d;
    --border-muted: #21262d;
    --error: #da3633;
    --warning: #fb8500;

    /* Typography */
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Base Styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-md);
    flex: 1;
}

/* Header */
.header {
    text-align: center;
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: var(--space-2xl);
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
}

.header h1 a {
    color: inherit;
    text-decoration: none;
}

.beta-badge {
    position: absolute;
    top: -8px;
    right: -40px;
    background-color: var(--warning);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-sans);
    -webkit-text-fill-color: var(--text-primary);
    -webkit-background-clip: initial;
    background-clip: initial;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.beta-warning {
    background-color: rgba(251, 133, 0, 0.1);
    border: 1px solid rgba(251, 133, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-top: var(--space-lg);
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
}

.beta-warning strong {
    color: var(--warning);
}

/* Main Content */
.section {
    margin-bottom: var(--space-2xl);
}

.section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.section p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* File Transfer UI */
.transfer-container {
    position: relative;
    min-height: 200px;
    margin-bottom: var(--space-xl);
}

.drop-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.drop-area:hover {
    border-color: var(--accent-secondary);
    background-color: var(--bg-tertiary);
}

.drop-area.highlight {
    border-color: var(--accent-primary);
    background-color: var(--bg-tertiary);
}

.drop-area p {
    color: var(--text-secondary);
    text-align: center;
    font-size: 1.1rem;
    margin: 0;
}

#file-input {
    display: none;
}

/* Share Link */
.share-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.share-link label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.share-link input {
    width: 100%;
    max-width: 500px;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-align: center;
}

.share-link input:focus {
    outline: 0px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* Progress Bar */
.upload-progress {
    display: none;
    margin-top: var(--space-lg);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.status-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-text {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    width: 0%;
    transition: width 0.3s ease;
}

/* Download Page */
.download-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
}

.file-info {
    margin-bottom: var(--space-lg);
}

.file-info p {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.file-info strong {
    color: var(--text-primary);
}

.button-download {
    display: inline-block;
    background-color: var(--accent-primary);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.button-download:hover {
    background-color: #388bfd; /* A lighter shade of accent-primary */
}

.button-download.disabled {
    background-color: var(--accent-secondary);
    cursor: not-allowed;
}

/* Code Blocks */
.code-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

code.inline-highlight {
    background-color: rgba(31, 111, 235, 0.1);
    color: var(--text-primary);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(31, 111, 235, 0.3);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.code-section h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.code-block {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin: var(--space-sm) 0;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre;
}

.code-comment {
    color: var(--text-muted);
    font-weight: 600;
}

.code-variable {
    color: var(--warning);
    font-style: italic;
}

.code-string {
    color: var(--accent-primary);
}

/* Info List */
.info-list {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.info-list ul {
    list-style: none;
}

.info-list li {
    position: relative;
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.info-list li:before {
    content: "•";
    color: var(--accent-primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.info-list li:last-child {
    margin-bottom: 0;
}

.info-list strong {
    color: var(--text-primary);
}

.info-list a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.info-list a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-default);
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */

/* Tablet and small desktop */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: var(--space-md);
    }

    .header {
        padding: var(--space-xl) 0;
    }

    .code-section {
        padding: var(--space-md);
    }

    .info-list {
        padding: var(--space-md);
    }
}

/* Mobile devices */
@media (max-width: 600px) {
    :root {
        --space-xs: 0.25rem;
        --space-sm: 0.375rem;
        --space-md: 0.75rem;
        --space-lg: 1rem;
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
    }

    .container {
        padding: var(--space-sm);
    }

    .header {
        padding: var(--space-lg) 0;
        margin-bottom: var(--space-lg);
    }

    .header h1 {
        font-size: 1.75rem;
        margin-bottom: var(--space-xs);
    }

    .header p {
        font-size: 0.95rem;
    }

    .beta-badge {
        position: static;
        display: inline-block;
        margin-left: var(--space-sm);
        margin-top: var(--space-xs);
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    .beta-warning {
        padding: var(--space-sm);
        margin-top: var(--space-md);
        font-size: 0.85rem;
    }

    .section {
        margin-bottom: var(--space-xl);
    }

    .section h2 {
        font-size: 1.1rem;
        margin-bottom: var(--space-sm);
    }

    .section p {
        font-size: 0.95rem;
        margin-bottom: var(--space-sm);
    }

    /* Mobile-optimized transfer area */
    .transfer-container {
        min-height: 180px;
        margin-bottom: var(--space-lg);
    }

    .drop-area {
        border-radius: var(--radius-md);
        padding: var(--space-lg);
        min-height: 180px;
        touch-action: none;
    }

    .drop-area p {
        font-size: 1rem;
        padding: var(--space-md);
        line-height: 1.4;
    }

    /* Make file input area larger for mobile touch */
    .drop-area::after {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        z-index: -1;
    }

    .share-link {
        padding: var(--space-md);
    }

    .share-link label {
        font-size: 0.95rem;
    }

    .share-link input {
        padding: var(--space-md);
        font-size: 0.85rem;
        max-width: 100%;
    }

    /* Progress bar mobile optimization */
    .upload-progress {
        margin-top: var(--space-md);
    }

    .progress-info {
        margin-bottom: var(--space-xs);
    }

    .status-text,
    .progress-text {
        font-size: 0.85rem;
    }

    .progress-bar {
        height: 10px;
    }

    /* Download page mobile */
    .download-container {
        padding: var(--space-md);
    }

    .file-info p {
        font-size: 0.95rem;
        margin-bottom: var(--space-xs);
    }

    .button-download {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
        width: 100%;
        display: block;
        text-align: center;
        touch-action: manipulation;
    }

    /* Code sections mobile - hide cURL section */
    .code-section {
        display: none;
    }

    .code-section h3 {
        font-size: 1rem;
        margin-bottom: var(--space-sm);
    }

    .code-section p {
        font-size: 0.9rem;
    }

    .code-block {
        padding: var(--space-sm);
        font-size: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .code-block code {
        font-size: 0.75rem;
    }

    code.inline-highlight {
        font-size: 0.85rem;
        padding: 0.05rem 0.3rem;
    }

    /* Info list mobile */
    .info-list {
        padding: var(--space-md);
    }

    .info-list h3 {
        font-size: 1rem;
        margin-bottom: var(--space-sm);
    }

    .info-list li {
        padding-left: var(--space-md);
        margin-bottom: var(--space-sm);
        font-size: 0.9rem;
    }

    /* Footer mobile */
    .footer {
        padding: var(--space-lg) 0;
        font-size: 0.85rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 375px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .beta-badge {
        display: block;
        margin-left: 0;
        margin-top: var(--space-sm);
        width: fit-content;
        margin-inline: auto;
    }

    .code-block {
        font-size: 0.7rem;
    }
}

/* Mobile landscape orientation */
@media (max-width: 900px) and (orientation: landscape) {
    .header {
        padding: var(--space-md) 0;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .transfer-container {
        min-height: 140px;
    }

    .drop-area {
        min-height: 140px;
    }
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .drop-area {
        cursor: default;
    }

    .button-download,
    .drop-area {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    a {
        -webkit-tap-highlight-color: rgba(31, 111, 235, 0.2);
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .progress-bar {
        transform: translateZ(0);
        will-change: width;
    }
}
