/* ==========================================================================
   FRIDAY STUDY - CLEAN, MODERN LEARNING INTERFACE DESIGN SYSTEM
   ========================================================================== */

/* Design Tokens */
:root {
    --bg-app: #080c16;
    --bg-surface: #0f172a;
    --bg-surface-hover: #1e293b;
    --bg-input: #131d35;
    
    --primary: #6366f1; /* Calming Indigo */
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    
    --success: #10b981; /* Soft Emerald */
    --success-light: rgba(16, 185, 129, 0.1);
    
    --error: #f43f5e; /* Soft Crimson/Rose */
    --error-light: rgba(244, 63, 94, 0.1);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(99, 102, 241, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-app);
    color: var(--text-secondary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Layout Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Component */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0;
    animation: simplePulse 2s infinite ease-out;
}

.logo-area h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.version-badge {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green {
    background-color: var(--success);
}

.status-dot.yellow {
    background-color: #f59e0b;
}

.status-text {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.time-readout {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.settings-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.02);
}

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

.icon-gear {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Settings Drawer / Box */
.settings-drawer {
    margin-bottom: 32px;
    animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.settings-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
}

.input-wrapper input {
    flex: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.btn-api-visibility {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-api-visibility:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.form-group small a {
    color: var(--primary);
    text-decoration: none;
}

.form-group small a:hover {
    text-decoration: underline;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    border: 1px solid var(--primary);
    color: white;
}

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Search and Topic Selection Section */
.search-section {
    margin-bottom: 40px;
}

.search-form {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 18px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    font-size: 1.1rem;
    margin-right: 12px;
    user-select: none;
    opacity: 0.7;
}

.search-input-wrapper input {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 12px 0;
    font-size: 1rem;
    font-family: var(--font-body);
}

.search-input-wrapper input:focus {
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.btn-submit {
    background-color: var(--primary);
    border: none;
    color: white;
    padding: 18px 32px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-submit:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Topic Suggestions */
.suggestions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-left: 4px;
}

.suggestion-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-suggestion {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

.btn-suggestion:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Loading & Progress States */
.loading-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    display: flex;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.loader-card {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 40%;
    background-color: var(--primary);
    border-radius: 3px;
    box-shadow: 0 0 8px var(--primary);
    animation: loadingBar 2s infinite ease-in-out;
}

.loader-status h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loader-status p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.loader-subtext {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Welcome Area */
.welcome-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 64px 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.welcome-card {
    max-width: 650px;
    margin: 0 auto;
}

.welcome-icon {
    font-size: 3.5rem;
    margin-bottom: 24px;
}

.welcome-card h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.welcome-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
    margin-bottom: 32px;
}

/* API Warning Alerts */
.api-warning-alert {
    display: flex;
    gap: 16px;
    background-color: var(--error-light);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-align: left;
    align-items: flex-start;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-body strong {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.alert-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

/* Main Workspace layout */
.workspace-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    margin-bottom: 64px;
    animation: fadeIn 0.3s ease-out;
}

.sidebar-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Clean Panels */
.content-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}

.content-panel:hover {
    box-shadow: var(--shadow-lg);
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.panel-body {
    padding: 24px;
}

.panel-body.scrollable {
    max-height: 700px;
    overflow-y: auto;
}

/* Custom Scrollbars */
.scrollable::-webkit-scrollbar {
    width: 6px;
}

.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 1. Learning Material Design */
.material-panel .panel-body {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.material-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.material-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.material-section h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.material-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.material-section p:last-child {
    margin-bottom: 0;
}

/* Bullet list stylings in material */
.material-section ul {
    list-style: none;
    padding-left: 4px;
    margin-top: 12px;
}

.material-section li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.material-section li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--primary);
    font-size: 1.1rem;
    top: -2px;
}

.study-methods-box {
    margin-top: 12px;
    border: 1px dashed rgba(99, 102, 241, 0.3);
    padding: 20px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
}

.study-methods-box h4 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    font-weight: 700;
}

.study-methods-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 2. Schedule Timeline Design */
.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 4px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-badge {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    border: 2px solid var(--primary);
    z-index: 2;
    transition: all 0.2s ease;
}

.timeline-item:hover .timeline-badge {
    background-color: var(--primary);
    transform: scale(1.2);
}

.timeline-content {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    transition: all 0.2s ease;
}

.timeline-item:hover .timeline-content {
    border-color: rgba(99, 102, 241, 0.3);
    background-color: rgba(255, 255, 255, 0.03);
}

.timeline-day {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-activity {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 500;
}

/* 3. Interactive Quiz Design */
.quiz-panel .panel-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quiz-score-overlay {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
}

.quiz-score-val {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.question-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideRight 0.25s ease-out;
}

.question-text {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-primary);
    border-left: 3px solid var(--primary);
    padding-left: 12px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.option-label {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
    background-color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.option-btn:hover:not(.disabled) {
    background-color: var(--bg-surface-hover);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    transform: translateX(4px);
}

/* Quiz Feedback States */
.option-btn.correct {
    background-color: var(--success-light) !important;
    border-color: var(--success) !important;
    color: var(--text-primary) !important;
}

.option-btn.correct .option-label {
    background-color: var(--success);
    border-color: var(--success);
    color: white;
}

.option-btn.incorrect {
    background-color: var(--error-light) !important;
    border-color: var(--error) !important;
    color: var(--text-primary) !important;
}

.option-btn.incorrect .option-label {
    background-color: var(--error);
    border-color: var(--error);
    color: white;
}

.option-btn.disabled {
    cursor: default;
    opacity: 0.5;
}

.feedback-alert {
    display: flex;
    gap: 12px;
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 0.85rem;
    animation: fadeIn 0.25s ease-out;
}

.feedback-alert.success {
    background-color: var(--success-light);
    border: 1px solid var(--success);
    color: var(--text-primary);
}

.feedback-alert.danger {
    background-color: var(--error-light);
    border: 1px solid var(--error);
    color: var(--text-primary);
}

.feedback-title {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 4px;
}

.feedback-title.correct { color: var(--success); }
.feedback-title.incorrect { color: var(--error); }

/* Quiz Navigation & Panel Footer */
.quiz-panel .panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.btn-nav-quiz {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-nav-quiz:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.btn-nav-quiz:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quiz-progression {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Footer Section */
.main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Utility Helper Classes */
.hidden {
    display: none !important;
}

/* Keyframes and Animations */
@keyframes simplePulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

@keyframes loadingBar {
    0% {
        left: -40%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: -40%;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
    .workspace-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-submit {
        width: 100%;
        text-align: center;
    }

    .main-footer {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        text-align: center;
    }
}
