/* CareSim Admin Portal - Light Green Minimalist Theme */

/* Reset global styles for admin portal */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body.admin-portal,
.admin-portal {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #FFF8F0;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    padding-top: 0;
}

/* Header - Fixed at top */
.portal-header {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #556B2F;
    letter-spacing: 1px;
}

.header-logo {
    height: 40px;
    width: auto;
}

.logo-text {
    color: #556B2F;
    font-weight: 600;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #64748B;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-tab:hover {
    background: #FAF0E6;
    color: #556B2F;
}

.nav-tab.active {
    background: #C19A6B;
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    color: #64748B;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: #556B2F;
    color: #556B2F;
    background: #FAF0E6;
}

/* Portal Container - Admin Dashboard */
.portal-container {
    max-width: min(1400px, 100vw);
    margin-left: auto;
    margin-right: auto;
    padding: 4px 24px 16px 24px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 72px;
    padding-left: max(24px, 1rem);
    padding-right: max(24px, 1rem);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

/* Section Styles */
.lessons-section,
.quizzes-section {
    width: 100%;
}

.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 8px 0;
}

.section-subtitle {
    font-size: 14px;
    color: #64748B;
    margin: 0;
}

/* Lessons Grid */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    width: 100%;
}

/* Lesson Card */
.lesson-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #E2E8F0;
    transition: all 0.2s;
}

.lesson-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.lesson-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.lesson-number {
    font-size: 12px;
    font-weight: 600;
    color: #556B2F;
    background: #FAF0E6;
    padding: 4px 12px;
    border-radius: 20px;
}

.lesson-name {
    font-size: 18px;
    font-weight: 600;
    color: #1E293B;
    margin: 0 0 8px 0;
}

.lesson-description {
    font-size: 14px;
    color: #64748B;
    line-height: 1.5;
    margin: 0;
}

/* Lesson Tabs for Quizzes */
.lesson-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    border-bottom: 2px solid #E2E8F0;
    padding-bottom: 0;
}

.lesson-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
    font-family: inherit;
}

.lesson-tab:hover {
    color: #556B2F;
    background: #FAF0E6;
    border-radius: 8px 8px 0 0;
}

.lesson-tab.active {
    color: #556B2F;
    border-bottom-color: #C19A6B;
    background: transparent;
    font-weight: 600;
}

/* Quizzes Section Header */
.quizzes-section-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E2E8F0;
}

.quizzes-section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1E293B;
    margin: 0 0 4px 0;
}

.quizzes-count {
    font-size: 14px;
    color: #64748B;
    margin: 0;
}

/* Quizzes Grid */
.quizzes-grid {
    width: 100%;
}

.quizzes-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    width: 100%;
}

/* Quiz Card */
.quiz-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #E2E8F0;
    transition: all 0.2s;
}

.quiz-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quiz-number {
    font-size: 12px;
    font-weight: 600;
    color: #556B2F;
    background: #FAF0E6;
    padding: 4px 12px;
    border-radius: 20px;
}

.quiz-question {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.answer-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    background: #F9FAFB;
    font-size: 14px;
    color: #64748B;
}

.answer-item.correct {
    background: #FAF0E6;
    border: 1px solid #C19A6B;
    color: #556B2F;
}

.answer-label {
    font-weight: 600;
    min-width: 24px;
    color: #1E293B;
}

.correct-answer-badge {
    font-size: 12px;
    font-weight: 600;
    color: #556B2F;
    background: #FAF0E6;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 8px;
    margin-bottom: 12px;
}

/* Explanation Section */
.explanation-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E2E8F0;
}

.explanation-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 6px;
}

.explanation-text {
    font-size: 13px;
    line-height: 1.5;
    color: #1E293B;
    padding: 8px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.explanation-empty {
    color: #94A3B8;
    font-style: italic;
}

/* Buttons */
.btn-edit {
    background: #C19A6B;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-edit:hover {
    background: #556B2F;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E2E8F0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1E293B;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748B;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #FAF0E6;
    color: #556B2F;
}

.modal form {
    padding: 24px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1E293B;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #1E293B;
    box-sizing: border-box;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #C19A6B;
    box-shadow: 0 0 0 3px rgba(193, 154, 107, 0.1);
}

.form-group input:disabled,
.form-group input[readonly] {
    background: #F9FAFB;
    color: #64748B;
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Character Counter */
.char-counter {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
    font-size: 12px;
    color: #64748B;
    font-weight: 500;
}

.char-counter span {
    font-weight: 600;
    color: #1E293B;
}

.char-counter.char-limit-reached {
    color: #EF4444;
}

.char-counter.char-limit-reached span {
    color: #EF4444;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #E2E8F0;
}

.btn-primary {
    background: #C19A6B;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #556B2F;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #64748B;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: #556B2F;
    color: #556B2F;
    background: #FAF0E6;
}

/* History Modal Styles (used for logout confirmation) */
.history-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.history-modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.history-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.history-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6B7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.history-close:hover {
    background: #F3F4F6;
    color: #111827;
}

.history-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Logout Modal Specific Styles */
.logout-modal-content {
    max-width: 400px;
}

.logout-modal-body {
    padding: 24px;
    text-align: center;
}

.logout-modal-body p {
    font-size: 16px;
    color: #1E293B;
    margin: 0;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portal-container {
        padding: 4px 16px 16px 16px;
        grid-template-columns: 1fr;
    }

    .lessons-grid,
    .quizzes-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

