/* CSS Variables - Claude-inspired theme */
:root {
    --primary-color: #DA7756;
    --primary-hover: #C96A4A;
    --primary-light: rgba(218, 119, 86, 0.1);
    --success-color: #2E7D32;
    --success-bg: rgba(46, 125, 50, 0.1);
    --error-color: #C62828;
    --error-bg: rgba(198, 40, 40, 0.1);
    --text-color: #1A1915;
    --text-secondary: #5D5D5A;
    --text-muted: #8E8E8A;
    --bg-color: #EEECE7;
    --bg-secondary: #E5E3DE;
    --card-bg: #FAF9F7;
    --border-color: #D4D1CA;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.07), 0 4px 6px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --font-family: 'Söhne', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Top Header Bar */
.top-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-title h1 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Page Intro */
.page-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Upload Section */
.upload-section {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

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

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

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.drop-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

.drop-text-small {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.file-label {
    display: inline-block;
    margin-top: 0.75rem;
}

.file-label span {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.file-label span:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.file-label input {
    display: none;
}

/* File Info */
.file-info {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.file-meta {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.file-size {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.remove-file {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.remove-file:hover {
    color: var(--error-color);
    background: var(--error-bg);
}

.remove-file svg {
    width: 20px;
    height: 20px;
}

/* Submit Button */
.submit-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

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

.btn-loading {
    align-items: center;
    gap: 0.5rem;
}

.btn-loading:not([hidden]) {
    display: flex;
}

/* Ensure hidden attribute works */
[hidden] {
    display: none !important;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status Section */
.status-section {
    margin-bottom: 1.5rem;
}

.status-message {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
}

.status-message.success {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-message.error {
    background: var(--error-bg);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.status-message.info {
    background: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Info Section */
.info-section {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.info-section h2 {
    margin: 0 0 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.info-section h3 {
    margin: 1.75rem 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Steps */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.steps li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
}

.steps li:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

.step-text {
    padding-top: 2px;
    color: var(--text-secondary);
    font-size: 0.925rem;
}

/* Rules Table */
.formatting-info {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.rules-table th,
.rules-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.rules-table th {
    font-weight: 600;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rules-table td {
    color: var(--text-secondary);
}

.rules-table td.green {
    color: var(--success-color);
    font-weight: 500;
}

.rules-table td.red {
    color: var(--error-color);
    font-weight: 500;
}

.rules-loading {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* =============================================================================
   User Header (in top bar)
   ============================================================================= */

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-color);
}

.user-email-small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--text-muted);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.logout-link:hover {
    color: var(--error-color);
    background: var(--error-bg);
}

.logout-link svg {
    width: 18px;
    height: 18px;
}

/* =============================================================================
   Login Page
   ============================================================================= */

.login-card {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-logo {
    width: 56px;
    height: 56px;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.login-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.login-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-error {
    background: var(--error-bg);
    border: 1px solid var(--error-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.login-error p {
    margin: 0;
    color: var(--error-color);
    font-size: 0.875rem;
}

.login-actions {
    margin-bottom: 2rem;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.google-btn:hover {
    background: var(--bg-color);
    box-shadow: var(--shadow-md);
    border-color: var(--text-muted);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.login-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =============================================================================
   Waitlist Page
   ============================================================================= */

.waitlist-card {
    max-width: 420px;
    margin: 4rem auto;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.waitlist-icon {
    margin-bottom: 1.5rem;
}

.waitlist-icon svg {
    width: 56px;
    height: 56px;
    color: var(--primary-color);
}

.waitlist-card h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.waitlist-user {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.user-email {
    margin: 0;
    font-weight: 500;
    color: var(--text-color);
    word-break: break-all;
    font-size: 0.95rem;
}

.waitlist-message {
    margin: 0 0 2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.925rem;
}

.waitlist-actions {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.logout-btn:hover {
    background: var(--error-bg);
    border-color: var(--error-color);
    color: var(--error-color);
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 600px) {
    .header-content {
        padding: 0.75rem 1rem;
    }

    .header-title h1 {
        font-size: 1rem;
    }

    .user-name {
        font-size: 0.8rem;
    }

    .user-email-small {
        display: none;
    }

    .container {
        padding: 1.25rem 1rem;
    }

    .upload-section,
    .info-section {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .rules-table th,
    .rules-table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }

    .login-card,
    .waitlist-card {
        margin: 1.5rem auto;
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }
}
