body {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* Logo Circle Outline */
.logo-circle {
    border: 2px solid #4f46e5; /* indigo-600 */
    border-radius: 50%;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Task Card Animations */
.task-card {
    transition: all 0.3s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Priority Indicators */
.priority-high {
    border-left: 4px solid #EF4444;
}

.priority-medium {
    border-left: 4px solid #F59E0B;
}

.priority-low {
    border-left: 4px solid #10B981;
}

/* Modal Backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner */
.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Status Badges */
.status-pending {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background-color: #dcfce7;
    color: #166534;
}

.status-overdue {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Priority Badges */
.priority-badge-high {
    background-color: #fee2e2;
    color: #dc2626;
}

.priority-badge-medium {
    background-color: #fef3c7;
    color: #d97706;
}

.priority-badge-low {
    background-color: #dcfce7;
    color: #16a34a;
}

/* Subject Badges */
.subject-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Subject Color Border for Task Cards */
.task-card.subject-colored {
    border-left-width: 4px;
}

/* Toast Notification */
#toast {
    min-width: 300px;
    max-width: 400px;
}

/* Loading Screen */
#loadingScreen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 1000;
    transform: translateY(100px);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* Button Hover Effects */
button {
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .task-card {
        margin-bottom: 1.5rem;
    }
    
    #tasksContainer {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .max-w-7xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
/* Mobile fixes - but don't hide elements by default */
    /* .hidden { display: none !important; } */
    
    /* Ensure grid columns work properly on mobile */
    .grid-cols-1 {
        grid-template-columns: 1fr;
    }
    
    /* Stats cards - stack vertically with more space */
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    /* Ensure extended analytics cards are visible on mobile */
    #extendedAnalytics {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    #extendedAnalytics > div {
        padding: 0.75rem;
    }
    
    /* Subject analytics cards - stack vertically */
    .grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Task container - single column */
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    /* Dashboard padding - reduce for mobile */
    #dashboardScreen .max-w-7xl {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    /* Dashboard header - smaller on mobile */
    #dashboardScreen .mb-8 {
        margin-bottom: 0.75rem;
    }
    
    #dashboardScreen .mb-8 h2 {
        font-size: 1.375rem;
        margin-bottom: 0.25rem;
    }
    
    #dashboardScreen .mb-8 p {
        font-size: 0.8125rem;
        color: #6b7280;
    }
    
    /* Statistics cards - keep visible but more compact */
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 > div {
        padding: 0.625rem;
    }
    
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 > div .p-3 {
        padding: 0.375rem;
        width: 32px;
        height: 32px;
    }
    
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 > div .text-2xl {
        font-size: 1.25rem;
    }
    
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 > div .text-sm {
        font-size: 0.6875rem;
    }
    
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 > div .ml-4 {
        margin-left: 0.375rem;
    }
    
    /* Extended stats cards - keep visible but compact on mobile */
    #productivityScoreCard,
    #focusAnalyticsCard,
    #procrastinationRiskCard {
        padding: 0.625rem;
    }
    
    #productivityScoreCard .text-4xl,
    #focusAnalyticsCard .text-2xl,
    #procrastinationRiskCard .text-lg {
        font-size: 1.125rem;
    }
    
    /* Keep extended analytics visible but compact */
    #extendedAnalytics {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }
    
    #extendedAnalytics > div {
        padding: 0.625rem;
    }
    
    /* Subject analytics cards - show minimal on mobile */
    .grid-cols-1.md\:grid-cols-3 > div {
        padding: 0.75rem;
    }
    
    .grid-cols-1.md\:grid-cols-3 > div .text-xl {
        font-size: 1rem;
    }
    
    /* Controls section - more spacing */
    .bg-white.rounded-xl.shadow-sm.p-6 {
        padding: 1rem;
    }
    
    .bg-white.rounded-xl.shadow-sm.p-6 .flex.flex-col.lg\:flex-row {
        gap: 0.75rem;
    }
    
    /* Buttons - full width on mobile, more spacing */
    .bg-white.rounded-xl.shadow-sm.p-6 button {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    /* Search and filters - stack on mobile */
    .bg-white.rounded-xl.shadow-sm.p-6 .flex.flex-col.sm\:flex-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .bg-white.rounded-xl.shadow-sm.p-6 .flex.flex-col.sm\:flex-row > * {
        width: 100%;
    }
    
    /* Controls section header */
    .bg-white.rounded-xl.shadow-sm.p-6 .flex.flex-col.lg\:flex-row .flex.flex-col.sm\:flex-row {
        width: 100%;
    }
    
    .flex.flex-col.lg\:flex-row .flex.flex-col.sm\:flex-row button {
        width: 100%;
        justify-content: center;
    }
    
    /* Form inputs - full width on mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem;
        margin-bottom: 0.5rem;
    }
    
    /* Toast notifications - full width with margins */
    #toast {
        left: 1rem;
        right: 1rem;
        min-width: auto;
        max-width: none;
        top: 5rem;
    }
    
    /* Modal - full screen on mobile */
    .fixed.inset-0.bg-black.bg-opacity-50 {
        padding: 0.25rem;
    }
    
    .fixed.inset-0.bg-black.bg-opacity-50 .bg-white {
        max-height: 95vh;
        margin: 0;
        border-radius: 0.5rem;
    }
    
    /* Floating timer - adjust size */
    #floatingTimer {
        bottom: 1rem;
        right: 1rem;
        min-width: 140px;
        padding: 0.75rem;
    }
    
    /* Calendar - responsive */
    .calendar-grid {
        overflow-x: auto;
    }
    
    .calendar-grid .grid-cols-7 {
        min-width: 300px;
    }
    
    /* Completion rate circle - smaller on mobile */
    .completion-rate-container {
        width: 100px;
        height: 100px;
    }
    
    .completion-rate-svg {
        width: 100px;
        height: 100px;
    }
    
    .completion-rate-inner {
        width: 80px;
        height: 80px;
    }
    
    .completion-rate-percent {
        font-size: 1.25rem;
    }
    
    /* Timer circle - smaller on mobile */
    .timer-circle {
        width: 140px;
        height: 140px;
    }
    
    .timer-display span {
        font-size: 2rem;
    }
    
    /* Proof thumbnail - adjust size */
    .proof-thumbnail {
        width: 32px;
        height: 32px;
    }
    
    /* Badge adjustments */
    .subject-badge {
        font-size: 0.65rem;
        padding: 1px 6px;
    }
    
    .priority-badge-high,
    .priority-badge-medium,
    .priority-badge-low {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
    
    /* Status badges */
    .status-pending,
    .status-completed,
    .status-overdue {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
    
    /* Task card - more spacious */
    .task-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .task-card h3 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .task-card p {
        font-size: 0.875rem;
    }
    
    .task-card .flex.justify-between {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .task-card .flex.items-center.space-x-2 {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Task card buttons - full width */
    .task-card .flex.justify-between button,
    .task-card .flex.justify-between > div {
        width: 100%;
    }
    
    .task-card .flex.justify-between > div.flex {
        justify-content: space-between;
    }
    
    /* Hide non-essential elements on very small screens */
    @media (max-width: 480px) {
        /* Keep all essential icons visible on mobile - just make them smaller */
        .fa-calendar-week,
        .fa-chart-pie,
        .fa-star,
        .fa-fire {
            font-size: 0.75rem;
        }

        /* Keep text visible but smaller */
        .due-this-week-card .text-xs,
        .analytics-card .text-xs {
            font-size: 0.625rem;
        }

        /* Keep buttons visible but stack them properly */
        .bg-white.rounded-xl.shadow-sm.p-6 .flex.flex-col.lg\:flex-row .flex:first-child {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        
        /* Make buttons smaller on mobile but keep them visible */
        .bg-white.rounded-xl.shadow-sm.p-6 .flex.flex-col.lg\:flex-row .flex:first-child button {
            width: 100%;
            padding: 0.625rem 0.75rem;
            font-size: 0.75rem;
        }
    }
    
    /* Ensure analytics section is visible */
    .analytics-section {
        display: block;
    }
    
    /* Study load banner - full width */
    #studyLoadBanner {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        padding: 1rem;
    }
    
    /* Escalation banner - full width */
    #escalationBanner {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
    
    /* Risk badge - responsive */
    .risk-badge {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .risk-badge button {
        margin-top: 0.5rem;
    }
    
    /* Productivity score - responsive */
    #productivityScoreCard {
        padding: 1rem;
    }
    
    #productivityScoreValue {
        font-size: 2rem;
    }
    
    /* Focus analytics - responsive */
    #focusAnalyticsCard {
        padding: 1rem;
    }
    
    #focusTotalHours {
        font-size: 1.5rem;
    }
    
    /* Procrastination risk - responsive */
    #procrastinationRiskCard {
        padding: 1rem;
    }
    
    #riskLevelText {
        font-size: 1.25rem;
    }
    
    /* Ensure extended analytics container exists and is visible */
    #extendedAnalytics {
        display: grid;
        grid-template-columns: 1fr;
    }
    
    /* Tab navigation if any */
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    /* Empty state - more spacious */
    #emptyState {
        padding: 3rem 1rem;
    }
    
    #emptyState .text-6xl {
        font-size: 4rem;
    }
    
    /* Loading screen */
    #loadingScreen .text-6xl {
        font-size: 3rem;
    }
    
    /* Auth screen */
    #authScreen .max-w-md {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    #authScreen .bg-white.rounded-xl {
        padding: 1.5rem;
    }
}

/* Ensure features are visible on all screen sizes - override hidden classes when needed */
@media (min-width: 769px) {
    .lg\:block {
        display: block !important;
    }
}

/* Additional mobile optimizations */
@media (max-width: 640px) {
    /* Adjust font sizes */
    body {
        font-size: 14px;
    }
    
    h1, h2, h3 {
        font-size: 1.1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* Button sizing */
    button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Touch-friendly */
    }
    
    /* Card padding */
    .p-6 {
        padding: 0.875rem;
    }
    
    /* Grid gap reduction */
    .gap-6 {
        gap: 0.75rem;
    }
    
    .gap-4 {
        gap: 0.5rem;
    }
    
    /* Navigation */
    nav .h-16 {
        height: 3.5rem;
    }
    
    nav h1 {
        font-size: 1.125rem;
    }
    
    /* Auth form */
    .max-w-md h2 {
        font-size: 1.5rem;
    }
}

/* Additional Utility Classes */
.line-through {
    text-decoration: line-through;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus States */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #6366f1;
    border-color: #6366f1;
}

/* Form Validation */
input:invalid {
    border-color: #ef4444;
}

input:valid {
    border-color: #10b981;
}

/* Loading States */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Gradient Backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

/* Animation Delays */
.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

/* Text Animations */
.text-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .task-card {
        break-inside: avoid;
        border: 1px solid #ccc !important;
        margin-bottom: 1rem;
    }
}

/* =========================================
CUSTOM STYLES FOR TASK KO TO!
   ========================================= */

/* =========================================
SUBJECT COLOR STYLES
   ========================================= */

/* Subject badge with color */
.subject-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    margin-right: 8px;
}

/* Task card with colored left border */
.task-card {
    border-left: 4px solid transparent !important;
    transition: all 0.2s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* =========================================
PRIORITY SCORE BADGES
   ========================================= */

/* Priority Score Badge Styles */
.priority-score-critical {
    background-color: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.priority-score-high {
    background-color: #FFEDD5;
    color: #EA580C;
    border: 1px solid #FED7AA;
}

.priority-score-normal {
    background-color: #D1FAE5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

/* =========================================
STUDY LOAD WARNING BANNER
   ========================================= */

#studyLoadBanner {
    transition: all 0.3s ease;
}

/* Warning state (3-4 tasks due tomorrow) */
#studyLoadBanner.warning {
    background-color: #FEF3C7;
    border-color: #F59E0B;
    color: #92400E;
}

#studyLoadBanner.warning #studyLoadIcon {
    color: #F59E0B;
}

/* Danger state (5+ tasks due tomorrow) */
#studyLoadBanner.danger {
    background-color: #FEE2E2;
    border-color: #EF4444;
    color: #991B1B;
}

#studyLoadBanner.danger #studyLoadIcon {
    color: #EF4444;
}

/* =========================================
ANALYTICS DASHBOARD STYLES
   ========================================= */

.analytics-section {
    margin-bottom: 2rem;
}

.analytics-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
    padding: 1.5rem;
}

.analytics-stat {
    text-align: center;
    padding: 1rem;
}

.analytics-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

.analytics-stat-label {
    font-size: 0.875rem;
    color: #6B7280;
    margin-top: 0.25rem;
}

.analytics-chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* =========================================
ENGAGING COMPLETION RATE DISPLAY
   ========================================= */

/* Completion Rate Container */
.completion-rate-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

/* SVG Circular Progress */
.completion-rate-svg {
    width: 140px;
    height: 140px;
    transform: rotate(-90deg);
}

/* Background circle */
.completion-rate-bg {
    fill: none;
    stroke: #E5E7EB;
    stroke-width: 10;
}

/* Progress circle */
.completion-rate-progress {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-in-out, stroke 0.5s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Inner circle with percentage */
.completion-rate-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Percentage text */
.completion-rate-percent {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    transition: color 0.3s ease;
}

/* Label text */
.completion-rate-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    color: #6B7280;
}

/* Icon container */
.completion-rate-icon {
    font-size: 1.25rem;
    margin-bottom: 2px;
    transition: transform 0.3s ease;
}

/* Pulse animation for the progress circle */
@keyframes completionPulse {
    0%, 100% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    }
    50% {
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    }
}

.completion-rate-progress.pulsing {
    animation: completionPulse 2s infinite;
}

/* Celebration animation - particles */
@keyframes celebrateParticle {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

.completion-celebration {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.completion-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particleBurst 1s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(1);
    }
}

/* Color variants */
.completion-rate-low {
    color: #EF4444;
}

.completion-rate-medium {
    color: #F59E0B;
}

.completion-rate-high {
    color: #10B981;
}

/* Glow effect for high completion */
.completion-rate-glow {
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

/* Smooth entrance animation */
@keyframes completionEnter {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.completion-rate-container.animate {
    animation: completionEnter 0.6s ease-out forwards;
}

/* Ring shadow effect */
.completion-rate-shadow {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* =========================================
TASK CARD ENHANCEMENTS
   ========================================= */

/* Task card priority border colors */
.task-card.priority-high {
    border-left-color: #EF4444 !important;
}

.task-card.priority-medium {
    border-left-color: #F59E0B !important;
}

.task-card.priority-low {
    border-left-color: #10B981 !important;
}

/* Overdue task styling */
.task-card.overdue {
    background-color: #FEF2F2;
}

/* =========================================
ANIMATIONS
   ========================================= */

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

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

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

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

@media (max-width: 768px) {
    .analytics-chart-container {
        height: 250px;
    }
    
    .completion-rate-circle {
        width: 100px;
        height: 100px;
        font-size: 1.25rem;
    }
}

/* =========================================
OFFLINE INDICATOR
   ========================================= */

.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #EF4444;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 9999;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.offline-indicator.show {
    transform: translateX(-50%) translateY(0);
}

/* =========================================
LOADING ANIMATIONS
   ========================================= */

.loading-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* =========================================
TIMER STYLES
   ========================================= */

/* Timer Circle */
.timer-circle {
    position: relative;
    width: 180px;
    height: 180px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg-circle {
    fill: none;
    stroke: #E5E7EB;
    stroke-width: 8;
}

.timer-progress-circle {
    fill: none;
    stroke: #8B5CF6;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-display span {
    font-size: 3rem;
    font-weight: 700;
    color: #1F2937;
}

#timerSeparator {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Timer Mode Styles */
.timer-mode-work {
    background-color: #EDE9FE;
    color: #7C3AED;
}

.timer-mode-break {
    background-color: #D1FAE5;
    color: #059669;
}

.timer-mode-paused {
    background-color: #FEF3C7;
    color: #D97706;
}

/* Floating Timer */
#floatingTimer {
    min-width: 160px;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

#floatingTimer.hidden {
    display: none;
}

.timer-icon-container {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Timer Button in Controls */
#timerBtn {
    background-color: #8B5CF6;
}

#timerBtn:hover {
    background-color: #7C3AED;
}

/* Timer Progress Animation */
.timer-progress-pulse {
    animation: timerPulse 2s infinite;
}

@keyframes timerPulse {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.8));
    }
}

/* Timer Complete Animation */
@keyframes timerComplete {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.timer-complete {
    animation: timerComplete 0.5s ease-in-out;
}

/* =========================================
PROOF OF COMPLETION MODAL STYLES
========================================= */

/* Drop Zone Styles */
#proofDropZone {
    border-color: #d1d5db;
    transition: all 0.3s ease;
}

#proofDropZone:hover {
    border-color: #6366f1;
    background-color: #eef2ff;
}

#proofDropZone.drag-over {
    border-color: #6366f1;
    background-color: #eef2ff;
    transform: scale(1.02);
}

/* Proof Preview */
#proofPreviewArea {
    padding: 1rem;
}

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.verified-badge i {
    font-size: 0.65rem;
}

/* Proof File Type Icons */
.proof-file-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.proof-file-icon.image {
    background-color: #dbeafe;
    color: #2563eb;
}

.proof-file-icon.video {
    background-color: #fce7f3;
    color: #db2777;
}

.proof-file-icon.document {
    background-color: #fef3c7;
    color: #d97706;
}

/* Proof Preview Modal Content */
#proofPreviewContent {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
}

/* Proof Thumbnail in Task Card */
.proof-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.proof-thumbnail:hover {
    transform: scale(1.1);
}

/* Error Message */
#proofFileError {
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: #fef2f2;
}

/* Upload Progress */
#proofUploadProgress {
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 8px;
}

#proofProgressBar {
    transition: width 0.3s ease;
}

/* =========================================
ESCALATION SYSTEM STYLES
   ========================================= */

/* Escalation Banner */
#escalationBanner {
    transition: all 0.3s ease;
}

#escalationBanner.hidden {
    display: none;
}

/* Escalation Badge */
.escalation-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.escalation-badge.warning {
    background-color: #FEF3C7;
    color: #D97706;
    border: 1px solid #FCD34D;
}

.escalation-badge.critical {
    background-color: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Reminder Count Badge */
.reminder-count-badge {
    display: inline-flex;
    align-items: center;
    background-color: #E0E7FF;
    color: #4F46E5;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Escalated Task Card Styling */
.task-card.escalated-warning {
    border: 2px solid #F59E0B !important;
    background-color: #FFFBEB;
}

.task-card.escalated-warning:hover {
    border-color: #D97706 !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.task-card.escalated-critical {
    border: 2px solid #DC2626 !important;
    background-color: #FEF2F2;
    animation: critical-pulse 2s infinite;
}

.task-card.escalated-critical:hover {
    border-color: #B91C1C !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

@keyframes critical-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
    }
}

/* Procrastination Flag Indicator */
.procrastination-flag {
    background-color: #DC2626;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* =========================================
PROCRASTINATION RISK DETECTOR STYLES
   ========================================= */

.risk-badge {
    transition: all 0.3s ease;
}

.risk-badge.hidden {
    display: none;
}

.risk-badge.high-risk {
    background-color: #FEE2E2;
    border: 1px solid #FECACA;
    border-left: 4px solid #DC2626;
}

.risk-badge.high-risk #riskBadgeLevel {
    color: #DC2626;
}

.risk-badge.high-risk #riskBadgeMessage {
    color: #991B1B;
}

.risk-badge.medium-risk {
    background-color: #FEF3C7;
    border: 1px solid #FDE68A;
    border-left: 4px solid #D97706;
}

.risk-badge.medium-risk #riskBadgeLevel {
    color: #D97706;
}

.risk-badge.medium-risk #riskBadgeMessage {
    color: #92400E;
}

.risk-badge.low-risk {
    background-color: #D1FAE5;
    border: 1px solid #A7F3D0;
    border-left: 4px solid #059669;
}

.risk-badge.low-risk #riskBadgeLevel {
    color: #059669;
}

.risk-badge.low-risk #riskBadgeMessage {
    color: #065F46;
}

/* =========================================
SMART STUDY PLANNER STYLES
   ========================================= */

#smartStudyPlannerSection {
    transition: all 0.3s ease;
}

#smartStudyPlannerSection .bg-gradient-to-r {
    transition: all 0.3s ease;
}

#smartStudyPlannerSection .bg-gradient-to-r:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

#smartStudyPlannerSection .cursor-pointer {
    cursor: pointer;
}

/* Task item hover effect */
#smartStudyPlannerSection .space-y-3 > div {
    transition: all 0.2s ease;
}

#smartStudyPlannerSection .space-y-3 > div:hover {
    transform: translateX(4px);
}

/* Priority badge animations */
#smartStudyPlannerSection .fa-fire {
    animation: pulse-fire 2s infinite;
}

@keyframes pulse-fire {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Empty state animation */
#smartStudyPlannerSection .fa-check-circle {
    animation: bounce-in 1s ease infinite;
}

@keyframes bounce-in {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #smartStudyPlannerSection .bg-gradient-to-r {
        padding: 1.25rem;
    }
    
    #smartStudyPlannerSection .text-xl font-bold {
        font-size: 1.125rem;
    }
    
    #smartStudyPlannerSection .text-3xl {
        font-size: 1.75rem;
    }
    
    #smartStudyPlannerSection .flex.items-start p-4 {
        padding: 0.75rem;
    }
    
    #smartStudyPlannerSection .w-8.h-8 {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
    }
}

/* =========================================
PRODUCTIVITY SCORE STYLES
   ========================================= */

.score-green {
    color: #10B981;
}

.score-yellow {
    color: #F59E0B;
}

.score-red {
    color: #EF4444;
}

#productivityScoreCard {
    transition: all 0.3s ease;
}

#productivityScoreCard:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Score tooltip animation */
#scoreTooltip {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* =========================================
MOBILE RESPONSIVENESS FIXES - Ensure all features work on mobile
========================================= */

/* Force show all essential elements on mobile */
@media (max-width: 768px) {
    /* Show all analytics cards on mobile */
    #productivityScoreCard,
    #focusAnalyticsCard,
    #procrastinationRiskCard,
    #studyStreakCard {
        display: block !important;
    }
    
    /* Ensure stats cards are visible */
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 > div {
        display: flex !important;
    }
    
    /* Ensure controls section is visible */
    .bg-white.rounded-xl.shadow-sm.p-6 {
        display: block !important;
    }
    
    /* Ensure all buttons are visible */
    #addTaskBtn,
    #calendarBtn,
    #checkDeadlinesBtn,
    #timerBtn {
        display: inline-flex !important;
    }
    
    /* Ensure search and filters are visible */
    #searchInput,
    #subjectFilter,
    #priorityFilter,
    #statusFilter {
        display: block !important;
    }
}

/* Ensure modals are scrollable on mobile */
@media (max-width: 480px) {
    .fixed.inset-0.bg-black.bg-opacity-50 .bg-white {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    /* Make modals full width on very small screens */
    .fixed.inset-0.bg-black.bg-opacity-50 {
        padding: 0.5rem;
    }
}

/* Ensure all cards render properly on mobile */
@media (max-width: 640px) {
    /* Statistics cards */
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-5 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Subject analytics cards */
    .grid-cols-1.md\:grid-cols-3 {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
    
    /* Extended analytics */
    #extendedAnalytics {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

/* Ensure proper button sizing on mobile */
@media (max-width: 480px) {
    button {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Control buttons */
    #addTaskBtn,
    #calendarBtn,
    #checkDeadlinesBtn,
    #timerBtn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Make filter section buttons stack */
    .bg-white.rounded-xl.shadow-sm.p-6 .flex.flex-col.sm\:flex-row {
        flex-direction: column !important;
    }
    
    .bg-white.rounded-xl.shadow-sm.p-6 .flex.flex-col.sm\:flex-row > * {
        width: 100% !important;
    }
}
