﻿:root {
    --primary: #10b981;
    /* Emerald Green */
    --primary-dark: #059669;
    --secondary: #d1fae5;
    --accent: #34d399;
    --success: #22c55e;
    --error: #ef4444;
    --surface: #ffffff;
    --background: #f0fdf4;
    /* Light Green Background */
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --login-bg: #3b5a7a;
    /* Pastest dark blue */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

/* ============ LOGIN PAGE ============ */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--login-bg) 0%, #2d4a63 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-brand {
    color: white;
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    text-align: center;
    font-size: 0.95rem;
}

.login-card {
    background: white;
    border-radius: 1rem;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text);
    font-weight: 400;
    font-size: 1.75rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 2rem;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.forgot-password {
    text-align: center;
    margin-top: 1.5rem;
}

.forgot-password a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.login-version {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-top: 3rem;
    font-size: 0.85rem;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ============ NAVBAR ============ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.brand-icon {
    width: 28px;
    height: 28px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    background: none;
    border: 2px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
}

/* ============ MAIN LAYOUT ============ */
#main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============ TABS ============ */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn:hover {
    color: var(--primary);
}

/* ============ COMPONENTS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.card {
    background-color: var(--surface);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

/* ============ FOLDER CARDS ============ */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* LIST VIEW STYLES */
.folder-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.folder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.folder-list .folder-card {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
}

.folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.folder-list .folder-card:hover {
    transform: translateX(4px);
    /* Horizontal shift for list items */
}

.folder-icon {
    width: 48px;
    height: 48px;
    background: var(--secondary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.folder-list .folder-icon {
    width: 36px;
    height: 36px;
    /* Smaller icon in list view */
}

.folder-list .folder-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.folder-info {
    flex-grow: 1;
    /* Take up remaining space */
}

.folder-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.folder-list .folder-info h3 {
    margin-bottom: 0;
    /* Align perfectly in row */
}

.folder-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============ PROGRESS CIRCLES ============ */
.progress-container {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin: 3rem 0;
}

.progress-circle {
    text-align: center;
}

.circle-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 1rem;
}

.circle-svg {
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 12;
}

.circle-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-label {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.progress-stats {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============ QUESTION STYLES ============ */
.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 1.25rem;
    background-color: white;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background-color: var(--secondary);
}

.option-btn.selected {
    border-color: var(--primary);
    background-color: var(--secondary);
    font-weight: 500;
}

.option-btn.correct {
    border-color: #22c55e !important;
    background-color: #dcfce7 !important;
    color: #15803d !important;
}

.option-btn.incorrect {
    border-color: #ef4444 !important;
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

.opt-letter {
    font-weight: 700;
    min-width: 24px;
    color: var(--text-muted);
}

.option-btn.selected .opt-letter,
.option-btn.correct .opt-letter,
.option-btn.incorrect .opt-letter {
    color: inherit;
}

.explanation-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f1f5f9;
    border-radius: 0.75rem;
    border-left: 5px solid var(--primary);
    animation: slideDown 0.3s ease-out;
}

.explanation-box h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ TABLE ============ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    background: var(--background);
}

/* ============ UTILITIES ============ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-muted {
    color: var(--text-muted);
}

/* ============ MODAL SYSTEM ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 1.25rem;
    width: 95%;
    max-width: 550px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.modal-close:hover {
    background: var(--background);
    color: var(--error);
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid var(--primary);
    transform: translateX(120%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
    max-width: 450px;
}

.toast.active {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast-message {
    font-size: 0.95rem;
    color: var(--text);
}

/* ============ LOADING SPINNER ============ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Breadcrumbs clickable */
.breadcrumbs .crumb-link {
    cursor: pointer;
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumbs .crumb-link:hover {
    color: var(--primary-dark);
}

/* Smaller folders for subfolders */
.folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Decrease min size */
}

.folder-card {
    padding: 1rem;
    /* Reduce padding */
}

.folder-card h3 {
    font-size: 1rem;
    /* Smaller Font */
}

/* Folder Image/Logo Styles */
.folder-image-container {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: var(--secondary);
    border-radius: 8px;
    overflow: hidden;
}

.folder-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.folder-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.folder-icon img.folder-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
}

/* ============ LIST VIEW STYLES ============ */
.folder-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.folder-list .folder-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
}

.folder-list .folder-image-container {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.folder-list .folder-card h3 {
    margin: 0;
    flex: 1;
    font-size: 1.1rem;
}

.folder-list .folder-actions {
    margin-top: 0 !important;
    gap: 1rem !important;
}

.folder-list .folder-icon-placeholder i {
    width: 24px !important;
    height: 24px !important;
}

/* ============ PASSMEDICINE LIST STYLE ============ */
.passmed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* No gap, borders handle separation */
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.passmed-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.1s;
}

.passmed-row:last-child {
    border-bottom: none;
}

.passmed-row:hover {
    background: #f8fafc;
}

.pm-check {
    margin-right: 1rem;
    display: flex;
    align-items: center;
}

.pm-name {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
}

.pm-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.pm-count {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.pm-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 1;
    /* Always visible for better UX */
    transition: opacity 0.2s;
}

.passmed-row:hover .pm-actions {
    opacity: 1;
}

.btn-icon-sm {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 4px;
}

.btn-icon-sm:hover {
    background: #e2e8f0;
    color: #475569;
}

.btn-icon-sm.text-danger:hover {
    color: #ef4444;
    background: #fee2e2;
}.profile-dropdown {
    position: relative;
    display: inline-block;
}

#profile-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    min-width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    z-index: 1000;
}

#profile-menu.hidden {
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--surface);
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
}
