/* ============================================================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ============================================================================ */

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

:root {
    --primary-color: #4A90E2;
    --secondary-color: #7B68EE;
    --success-color: #50C878;
    --error-color: #FF6B6B;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --border-color: #E1E8ED;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================================================
   HEADER
   ============================================================================ */

header {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--bg-white);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card-error {
    border-left: 4px solid var(--error-color);
}

.hidden {
    display: none !important;
}

/* ============================================================================
   FORM
   ============================================================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

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

.btn-primary:hover:not(:disabled) {
    background: #3A7BC8;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #6B58D8;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ============================================================================
   PROGRESS
   ============================================================================ */

.progress-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: 6px;
}

.status-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.status-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================================================
   ANALYSIS TEXT
   ============================================================================ */

.analysis-text {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

/* ============================================================================
   VISUALIZATION
   ============================================================================ */

#viz-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

#viz-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--bg-white);
    opacity: 0.9;
}

footer a {
    color: var(--bg-white);
    text-decoration: none;
    font-weight: 600;
}

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

.hire-link {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.hire-link a {
    font-weight: 400;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.hire-link a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ============================================================================
   TABLET & DESKTOP (min-width: 768px)
   ============================================================================ */

@media (min-width: 768px) {
    body {
        padding: 2rem;
    }

    .container {
        max-width: 700px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.125rem;
    }

    .card {
        padding: 2rem;
    }

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

    .action-buttons .btn {
        width: auto;
        flex: 1;
    }
}

/* ============================================================================
   LARGE DESKTOP (min-width: 1024px)
   ============================================================================ */

@media (min-width: 1024px) {
    .container {
        max-width: 800px;
    }

    header h1 {
        font-size: 3rem;
    }

    .card {
        padding: 2.5rem;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

.card {
    animation: fadeIn 0.3s ease-out;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
