:root {
    /* Color Palette */
    --primary-color: #4F46E5;       /* Deep Indigo */
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary-color: #06B6D4;     /* Cyan */
    --success-color: #10B981;
    --bg-color: #F8FAFC;            /* Very light blue-gray */
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --glass-border: rgba(255, 255, 255, 0.5);
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.3);
    
    /* Layout */
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --radius-sm: 0.5rem;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* --- Animations --- */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(79, 70, 229, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

.slideInUp { animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

/* --- Navbar Glassmorphism --- */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon-wrapper {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.2;
    color: var(--text-main);
}

.brand-subtitle {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.navbar-status {
    margin-left: 2rem;
}

.system-status {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

/* --- Buttons --- */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-glow {
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-login-custom {
    color: var(--primary-color);
    font-weight: 600;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 8px;
    padding: 8px 20px;
    transition: all 0.3s;
}

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

/* --- System Info Hero --- */
.system-info-panel {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 2rem;
    background-image: radial-gradient(circle at top right, rgba(79, 70, 229, 0.05) 0%, transparent 40%);
}

.feature-badges {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.badge-custom {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
}

/* --- Stepper --- */
.step-indicator-wrapper {
    margin-bottom: 3rem;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    cursor: default;
    opacity: 0.6;
    transition: all 0.3s;
}

.step.active {
    opacity: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #CBD5E1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.step.active .step-circle {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.2);
}

.step-connector {
    flex-grow: 1;
    height: 2px;
    background: #E2E8F0;
    margin: 0 10px;
    margin-bottom: 30px; /* Align with circle center */
}

/* --- Cards & Inputs --- */
.main-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--card-bg);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card-header-custom {
    padding: 1.25rem 1.5rem;
    background: white;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-textarea {
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-size: 1rem;
    resize: none;
    background: #F8FAFC;
    transition: all 0.3s;
}

.custom-textarea:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* --- Input Tabs --- */
.input-method-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.input-method-tabs {
    background: #F1F5F9;
    padding: 4px;
    border-radius: 12px;
    display: inline-flex;
}

.input-method-tab {
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s;
}

.input-method-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.input-method-content {
    display: none;
}
.input-method-content.active {
    display: block;
    animation: slideInUp 0.4s;
}

/* --- Speech Input --- */
.speech-input-container {
    text-align: center;
    padding: 3rem;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
    border-radius: var(--radius-lg);
}

.speech-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}

.speech-btn:hover {
    transform: scale(1.1);
}

/* --- Sample Cards --- */
.sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.sample-card {
    background: white;
    border: 1px solid #E2E8F0;
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.sample-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.sample-card .icon {
    font-size: 2rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

/* --- Analysis Results (FLEX FIX) --- */
.requirements-list-container {
    /* Removed max-height so it fills flex container */
    flex-grow: 1; 
    overflow-y: auto;
    padding: 1rem;
    min-height: 400px; /* Backup height if content is empty */
}

/* Custom Scrollbar for list container */
.requirements-list-container::-webkit-scrollbar {
    width: 8px;
}
.requirements-list-container::-webkit-scrollbar-track {
    background: #f1f5f9; 
}
.requirements-list-container::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 4px;
}
.requirements-list-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}

.req-item {
    background: white;
    border-left: 4px solid #ccc;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.req-item:hover {
    transform: translateX(5px);
}

.req-functional { border-left-color: var(--primary-color); }
.req-non-functional { border-left-color: var(--secondary-color); }

.stat-box {
    text-align: center;
    background: #F8FAFC;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    flex: 1;
    margin: 0 0.5rem;
}

/* --- Code/Diagrams --- */
.code-window {
    background: #1E293B;
    border-radius: 8px;
    padding: 1.5rem;
    color: #E2E8F0;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    border: 1px solid #334155;
}

.user-stories-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.story-card {
    background: #FFF;
    border: 1px solid #E2E8F0;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 6px;
    border-left: 3px solid var(--success-color);
}

/* --- Integration Cards --- */
.integration-card {
    background: white;
    border: 1px solid #E2E8F0;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.integration-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.integration-card .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.integration-card .icon.jira { background: #DEEBFF; color: #0052CC; }
.integration-card .icon.trello { background: #E6FCFF; color: #0079BF; }
.integration-card .icon.pdf { background: #FEE2E2; color: #DC2626; }
.integration-card .icon.json { background: #F3F4F6; color: #4B5563; }

.integration-card .details h6 { margin: 0; font-weight: 600; }
.integration-card .arrow { margin-left: auto; color: #CBD5E1; }

/* --- Modals (Glass) --- */
.glass-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: 16px;
}

.input-group-custom {
    position: relative;
}

.input-group-custom .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 10;
}

.input-group-custom input {
    padding-left: 45px;
    padding-top: 12px;
    padding-bottom: 12px;
    border-radius: 8px;
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none; /* JS toggles this */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

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

.spinner-custom {
    width: 60px;
    height: 60px;
    border: 4px solid #E2E8F0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Footer */
.main-footer {
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid #E2E8F0;
    margin-top: 5rem;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.2rem;
}

.social-links a { color: var(--text-muted); transition: color 0.2s; }
.social-links a:hover { color: var(--primary-color); }

/* Utility */
.section { display: none; }
.section.active { display: block; }