/* E-Notes Redesigned - Subject Cards, Weeks Modal & Content Modal with 65/35 Layout */

/* ==================== SUBJECT CARDS GRID ==================== */

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
}

@media (max-width: 768px) {
    .subjects-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== SUBJECT CARD ==================== */

.subject-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.subject-card:active {
    transform: translateY(-2px);
}

.status-graded {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #1e293b;
    font-size: 0.95rem;
}

.graded-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #16a34a;
    font-weight: 600;
}

.teacher-feedback {
    background: #f8fafc;
    border-left: 4px solid #16a34a;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.teacher-feedback strong {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.teacher-feedback p {
    margin: 0;
    color: #334155;
    font-style: italic;
}

.final-score-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    color: #92400e !important;
    border: 1px solid #fcd34d !important;
}

.final-score-badge i {
    color: #d97706;
}

.submission-modal-footer .status-success {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #16a34a;
    font-weight: 500;
}

.subject-card-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.subject-card-icon {
    font-size: 1.75rem;
}

.subject-card-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin: 0;
    flex: 1;
}

.subject-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subject-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subject-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.subject-meta-item i {
    width: 16px;
    color: var(--primary-color);
}

.subject-card-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.indicator-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
}

.notes-badge {
    background: #DBEAFE;
    color: #1E40AF;
}

.assignments-badge {
    background: #FEF3C7;
    color: #92400E;
}

/* ==================== TERMS MODAL ==================== */

.terms-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.terms-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.terms-modal-content {
    background: white;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.terms-modal-overlay.active .terms-modal-content {
    transform: scale(1) translateY(0);
}

.terms-modal-header {
    padding: 1.5rem;
    color: white;
    position: relative;
}

.terms-modal-header h2 {
    margin: 0;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terms-modal-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: var(--font-size-base);
    opacity: 0.9;
}

.terms-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Terms List */
.terms-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.term-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.term-item:hover {
    background: #f3f4f6;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.term-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.term-item-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.term-item-info {
    flex: 1;
}

.term-item-info h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.term-details {
    margin: 0.25rem 0 0 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.term-item-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.term-item:hover .term-item-arrow {
    background: var(--primary-color);
    color: white;
}

/* ==================== WEEKS MODAL ==================== */

.weeks-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.weeks-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.weeks-modal-content {
    background: white;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.weeks-modal-overlay.active .weeks-modal-content {
    transform: scale(1) translateY(0);
}

.weeks-modal-header {
    padding: 1.5rem;
    color: white;
    position: relative;
}

.weeks-modal-header h2 {
    margin: 0;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weeks-modal-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: var(--font-size-base);
    opacity: 0.9;
}

.weeks-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Weeks List */
.weeks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.week-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.week-item:hover {
    background: #f3f4f6;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.week-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.week-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.week-item-info {
    flex: 1;
}

.week-item-info h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.week-topic {
    margin: 0.25rem 0 0 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.week-item-indicators {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.week-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
}

.week-badge.assignment {
    background: #FEF3C7;
    color: #92400E;
}

.week-badge.content {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ==================== CONTENT MODAL (65/35 Layout) ==================== */

.content-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.content-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.content-modal-content {
    background: white;
    width: 95vw;
    height: 95vh;
    max-width: 1400px;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-modal-overlay.active .content-modal-content {
    transform: scale(1);
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .content-modal-content {
        width: 90vw;
        height: 90vh;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .content-modal-content {
        width: 85vw;
        height: 85vh;
        max-width: 1200px;
    }
}

.content-modal-header {
    padding: 1.25rem 1.5rem;
    color: white;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-modal-header h2 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    flex: 1;
}

.content-modal-subtitle {
    margin: 0;
    font-size: var(--font-size-base);
    opacity: 0.9;
}

.btn-close-modal,
.btn-back-modal {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.btn-close-modal:hover,
.btn-back-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.content-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .content-modal-body {
        flex-direction: row;
    }
}

/* Notes Section (65%) */
.content-notes-section {
    flex: 0 0 65%;
    overflow-y: auto;
    padding: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

@media (min-width: 1024px) {
    .content-notes-section {
        border-bottom: none;
        border-right: 2px solid #e5e7eb;
    }
}

.content-section-header {
    margin-bottom: 1.5rem;
}

.content-section-header h3 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-section-header h3 i {
    color: var(--primary-color);
}

.notes-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.note-item h4 {
    margin: 0 0 1rem 0;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

/* Assignment Section (35%) */
.content-assignment-section {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #f9fafb;
}

.content-assignment-section .content-section-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f9fafb;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.assignment-scrollable-content {
    flex: 1;
    overflow: visible;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.assignment-item {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    margin-bottom: 1rem;
}

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

.assignment-header-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.assignment-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.assignment-status-badge.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.assignment-status-badge.status-submitted {
    background: #D1FAE5;
    color: #065F46;
}

.assignment-status-badge.status-overdue {
    background: #FEE2E2;
    color: #991B1B;
}

.assignment-status-badge.status-available {
    background: #DBEAFE;
    color: #1E40AF;
}

.assignment-deadline,
.assignment-max-score {
    margin: 0.5rem 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.assignment-instructions {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.assignment-instructions h4 {
    margin: 0 0 0.75rem 0;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.btn-submit-assignment {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-submit-assignment:hover:not(:disabled) {
    background: #e2e8f0;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-submit-assignment:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit-assignment:disabled {
    background: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== CONTENT RENDERING ==================== */

/* Quill.js Read-Only Content */
.quill-rendered-content .ql-editor,
.assignment-instructions-content .ql-editor {
    font-size: var(--font-size-base);
    line-height: 1.8;
    color: var(--text-secondary);
}

.quill-rendered-content .ql-editor h1,
.assignment-instructions-content .ql-editor h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin: 1.5rem 0 1rem 0;
    color: var(--text-primary);
}

.quill-rendered-content .ql-editor h2,
.assignment-instructions-content .ql-editor h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 1.25rem 0 0.75rem 0;
    color: var(--text-primary);
}

.quill-rendered-content .ql-editor h3,
.assignment-instructions-content .ql-editor h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin: 1rem 0 0.5rem 0;
    color: var(--text-primary);
}

.quill-rendered-content .ql-editor h4,
.assignment-instructions-content .ql-editor h4 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    margin: 0.75rem 0 0.5rem 0;
    color: var(--text-primary);
}

.quill-rendered-content .ql-editor p,
.assignment-instructions-content .ql-editor p {
    margin: 0.5rem 0;
}

.quill-rendered-content .ql-editor strong,
.assignment-instructions-content .ql-editor strong {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.quill-rendered-content .ql-editor img,
.assignment-instructions-content .ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.quill-rendered-content .ql-editor ul,
.assignment-instructions-content .ql-editor ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.quill-rendered-content .ql-editor ul ul,
.assignment-instructions-content .ql-editor ul ul {
    padding-left: 2rem;
    list-style-type: circle;
}

.quill-rendered-content .ql-editor li,
.assignment-instructions-content .ql-editor li {
    margin: 0.25rem 0;
    line-height: 1.6;
}

.empty-content {
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.6;
    padding: 3rem 1rem;
    font-style: italic;
}

.empty-content p {
    margin: 0.5rem 0 0 0;
    font-size: var(--font-size-base);
}

.quill-image {
    margin: 1.5rem 0;
    text-align: center;
}

.quill-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .quill-image {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }

    .quill-image img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }
}

.quill-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.quill-list li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

.quill-list.indent-1 {
    padding-left: 3rem;
    list-style-type: circle;
}

.quill-list.indent-2 {
    padding-left: 4.5rem;
    list-style-type: square;
}

/* ==================== SUBMISSION MODAL ==================== */

.submission-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.submission-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.submission-modal-content {
    background: #ffffff;
    width: 95vw;
    height: 95vh;
    max-width: 1400px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(20px);
    opacity: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.submission-modal-overlay.active .submission-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Tablet & Desktop sizes */
@media (min-width: 768px) and (max-width: 1024px) {
    .submission-modal-content {
        width: 90vw;
        height: 90vh;
    }
}

@media (min-width: 1024px) {
    .submission-modal-content {
        width: 85vw;
        height: 85vh;
        max-width: 1200px;
    }
}

.submission-modal-header {
    padding: 1.5rem 2rem;
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.submission-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #16a34a, #047857);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.submission-modal-header h2 i {
    color: #16a34a;
    -webkit-text-fill-color: initial;
}

.btn-close-modal {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

.submission-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    background: #ffffff;
}

.tooltip-container {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    overflow: visible;
}

.tooltip-popover {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    width: max-content;
    max-width: 400px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.tooltip-container:hover .tooltip-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-popover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3b82f6, #2563eb);
}

.submission-instructions-content {
    padding: 1.25rem;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
}

.submission-instructions-content .ql-editor {
    padding: 0;
}

.submission-meta-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.instructions-badge {
    background: #f1f5f9;
    color: #2e7d32;
    border: none;
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    cursor: default;
    transition: all 0.2s ease;
}

.instructions-badge:hover {
    background: #e2e8f0;
    color: #1b5e20;
}

.deadline-badge {
    background: #fffbeb;
    color: #b45309;
}

.deadline-badge i {
    color: #f59e0b;
}

.score-badge {
    background: #f0fdf4;
    color: #15803d;
}

.score-badge i {
    color: #22c55e;
}

.submission-editor-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.premium-editor-container {
    flex: 1;
    background: white;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.premium-editor-container:focus-within {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.premium-editor-container .ql-toolbar {
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #f8fafc;
    border-radius: 0;
    padding: 0.75rem 1.5rem !important;
}

.premium-editor-container .ql-container {
    border: none !important;
    font-size: 1.05rem;
    font-family: inherit;
    flex: 1;
    overflow: visible !important;
    /* Allow tooltips to go outside container */
    position: relative;
    display: flex;
    flex-direction: column;
}

.premium-editor-container .ql-editor {
    min-height: 100%;
    line-height: 1.8;
    padding: 1.5rem;
    color: #334155;
    overflow-y: auto;
    /* Enable scrolling on the editor itself instead */
}

/* Image scaling fixes */
.premium-editor-container .ql-editor img {
    max-width: 50%;
    /* Reduced to 50% of the container width */
    height: auto;
    display: block;
    margin: 1rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Quill Tooltip Fixes */
.ql-snow .ql-tooltip {
    z-index: 3000 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e2e8f0 !important;
    background: white !important;
    padding: 8px 12px !important;
}

.ql-snow .ql-tooltip input[type=text] {
    border-radius: 4px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 4px 8px !important;
}

/* Adjust tooltip when near right edge */
.ql-snow .ql-tooltip.ql-flip {
    transform: translateX(-90%) !important;
}

/* Tiny Inline Editor Spinner */
.inline-editor-spinner {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.submission-modal-footer {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-shrink: 0;
}

#submission-status-message {
    flex: 1;
}

.status-success,
.status-graded {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

.status-success {
    background: #f0fdf4;
    color: #15803d;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.status-graded {
    background: #f0f9ff;
    color: #0369a1;
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.2);
}

.premium-gradient-btn {
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: white;
    border: none;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.premium-gradient-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, #16a34a, #166534);
}

.premium-gradient-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.premium-gradient-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* ==================== LOADING & EMPTY STATES ==================== */
*/ .loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.spinner-small {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: var(--font-size-lg);
    margin: 0;
}

.error-state {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    font-size: var(--font-size-base);
}

.error-state i {
    margin-right: 0.5rem;
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */

@media (max-width: 768px) {
    .weeks-modal-content {
        max-height: 90vh;
        border-radius: 12px;
    }

    .content-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .content-notes-section {
        flex: 0 0 65%;
        padding: 1rem;
    }

    .content-assignment-section {
        flex: 0 0 35%;
        padding: 1rem;
    }

    .content-modal-header h2 {
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .subject-card-name {
        font-size: var(--font-size-base);
    }

    .weeks-modal-header h2 {
        font-size: var(--font-size-xl);
    }
}

@media (min-width: 1024px) {
    .content-modal-body {
        flex-direction: row;
    }

    .content-notes-section {
        flex: 0 0 65%;
        border-bottom: none;
        border-right: 2px solid #e5e7eb;
    }

    .content-assignment-section {
        flex: 0 0 35%;
        border-top: none;
    }
}