/* IB Catalyst - Custom Styles */

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Navigation Buttons */
.nav-btn {
    color: #9CA3AF;
    transition: all 0.2s ease;
}

.nav-btn.active {
    color: #4F46E5;
}

.nav-btn:hover {
    color: #4F46E5;
}

/* Filter Buttons */
.filter-btn {
    background-color: #F3F4F6;
    color: #6B7280;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background-color: #4F46E5;
    color: white;
}

.filter-btn:hover:not(.active) {
    background-color: #E5E7EB;
}

/* Type Filter Buttons */
.type-btn {
    background-color: #F3F4F6;
    color: #6B7280;
    transition: all 0.2s ease;
}

.type-btn.active {
    background-color: #7C3AED;
    color: white;
}

.type-btn:hover:not(.active) {
    background-color: #E5E7EB;
}

/* Term Filter Buttons */
.term-filter-btn {
    background-color: #F3F4F6;
    color: #6B7280;
    transition: all 0.2s ease;
}

.term-filter-btn.active {
    background-color: #10B981;
    color: white;
}

.term-filter-btn:hover:not(.active) {
    background-color: #E5E7EB;
}

/* Difficulty Buttons */
.difficulty-btn {
    transition: all 0.2s ease;
    opacity: 0.5;
}

.difficulty-btn.active {
    opacity: 1;
}

.difficulty-btn[data-level="1"].active {
    background-color: #10B981;
    color: white;
    border-color: #10B981;
}

.difficulty-btn[data-level="2"].active {
    background-color: #F59E0B;
    color: white;
    border-color: #F59E0B;
}

.difficulty-btn[data-level="3"].active {
    background-color: #EF4444;
    color: white;
    border-color: #EF4444;
}

/* Task Cards */
.task-card {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.task-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.task-card.completed {
    opacity: 0.6;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: #9CA3AF;
}

/* Type Tags */
.type-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
}

.type-tag.homework {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

.type-tag.ee {
    background-color: #F3E8FF;
    color: #7C3AED;
}

.type-tag.ia {
    background-color: #DCFCE7;
    color: #16A34A;
}

.type-tag.tok {
    background-color: #FEF3C7;
    color: #D97706;
}

.type-tag.cas {
    background-color: #FCE7F3;
    color: #DB2777;
}

.type-tag.other {
    background-color: #F3F4F6;
    color: #6B7280;
}

/* Difficulty Indicators */
.difficulty-indicator {
    display: flex;
    gap: 0.125rem;
}

.difficulty-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background-color: #E5E7EB;
}

.difficulty-dot.active.low {
    background-color: #10B981;
}

.difficulty-dot.active.medium {
    background-color: #F59E0B;
}

.difficulty-dot.active.high {
    background-color: #EF4444;
}

/* Term Accordion */
.term-item {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.term-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.term-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.term-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.term-item.expanded .term-content {
    max-height: 500px;
}

.term-item.expanded .term-arrow {
    transform: rotate(180deg);
}

.term-arrow {
    transition: transform 0.3s ease;
}

/* Flashcard */
.flashcard {
    perspective: 1000px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flashcard-back {
    transform: rotateY(180deg);
}

/* Modal Animation */
.modal {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal .modal-content {
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

@media (min-width: 640px) {
    .modal .modal-content {
        transform: scale(0.95);
    }
    
    .modal.show .modal-content {
        transform: scale(1);
    }
}

/* Vocabulary Card */
.vocab-card {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.vocab-card .meaning {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-top: 0;
}

.vocab-card.expanded .meaning {
    max-height: 200px;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #E5E7EB;
}

/* Due Date Colors */
.due-overdue {
    color: #EF4444;
}

.due-today {
    color: #F59E0B;
}

.due-soon {
    color: #F59E0B;
}

.due-normal {
    color: #6B7280;
}

/* Progress Chart Container */
#progressChart {
    max-height: 128px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Subject Button Active State */
.subject-btn.active {
    border: 2px solid #4F46E5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9CA3AF;
}

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

/* Checkbox Style */
.task-checkbox {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #D1D5DB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: #4F46E5;
}

.task-checkbox.checked {
    background-color: #10B981;
    border-color: #10B981;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
