
/* StudyMaxx Pro Styling */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-purple: #a855f7;
    --deep-purple: #3b0764;
    --soft-purple: #d8b4fe;
    --darkest: #020105;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    /* Fixed the disappearing gradient: Using a linear-gradient with explicit black fallbacks */
    /* background: linear-gradient(180deg, #1a0830 0%, #0c0418 30%, #000000 100%) no-repeat fixed;
    background-color: var(--darkest); */
    color: white;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

/* Big Bento Tiles */


.calendar-day {
    min-height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 1rem;
    padding: 10px;
}

.calendar-day:hover {
    background: rgba(168, 85, 247, 0.18); /* Slightly brighter */
    border-color: rgba(168, 85, 247, 0.8);
    transform: translateY(-12px) scale(1.05); /* Increased lift */
    box-shadow: 0 30px 60px -15px rgba(168, 85, 247, 0.5);
    z-index: 20;
}

.calendar-day.today {
    border-color: var(--primary-purple);
    background: rgba(168, 85, 247, 0.15);
    border-width: 2px;
    box-shadow: inset 0 0 30px rgba(168, 85, 247, 0.15);
}

.calendar-day.spacer {
    pointer-events: none;
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.05);
}

.date-number {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.reminder-chip {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--primary-purple);
    background: rgba(168, 85, 247, 0.1);
    color: #efefff;
    transition: all 0.2s ease;
    cursor: default;
}

.calendar-day:hover .reminders-container {
    max-height: 200px; /* Allows more detail to show */
    overflow-y: auto;
}

.calendar-day:hover .reminder-chip {
    padding: 8px 12px; /* Bigger padding on hover */
    background: rgba(168, 85, 247, 0.25);
    border-left-width: 5px; /* Thicker accent */
}

.reminders-container {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 80px; /* Limits size in "static" view */
    overflow: hidden;
    transition: max-height 0.3s ease;
}


.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    
    /* FIX: Rounded edges */
    border-radius: 2.5rem !important; 
    overflow: hidden; /* This is crucial to make the rounding visible */
    
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Add a hover effect to the stats cards to make them feel interactive */
.glass-card:hover {
    border-top: 1px solid rgba(168, 85, 247, 0.8);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.9), 
                0 0 30px rgba(168, 85, 247, 0.1);
}

.btn-discard {
    font-family: 'Plus Jakarta Sans', sans-serif !important; /* Forces the correct font */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    /* Optional: give it a slight border to match the aesthetic */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.btn-discard:hover {
    background: rgba(255, 68, 68, 0.1);
    border-color: #ff4444;
    color: #ff4444 !important; /* Forces the font color to red */
    opacity: 1; /* Ensures it is fully visible */
}
/* reminder priority */

.reminder-chip.exam { 
    border-left-color: #ef4444; /* Red */
    background: rgba(239, 68, 68, 0.2); 
}
.reminder-chip.homework { 
    border-left-color: #22c55e; /* Green */
    background: rgba(34, 197, 94, 0.2); 
}
.reminder-chip.reading { 
    border-left-color: #3b82f6; /* Blue */
    background: rgba(59, 130, 246, 0.2); 
}
.reminder-chip.general { 
    border-left-color: #a855f7; /* Default Purple */
    background: rgba(168, 85, 247, 0.2); 
}



/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #581c87; border-radius: 10px; border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #7e22ce; }

/* Responsive adjustments */


/* Container and Layouts */
.container { 
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem 2rem;
}

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 12px;
    padding: 2rem;
}

.bg-video { 
    position: fixed; 
    inset: 0; 
    width: 100%; 
    height: 100%;
    object-fit: cover; 
    z-index: -50; 
}

/* Stats Section */
.stats-grid { 
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Force 3 columns on desktop */
    gap: 1.5rem;
    margin-bottom: 3rem; 

}

.stat-item .icon {
    font-size: 2.5rem;
    background: rgba(168, 85, 247, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
}

.stat-item { 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; 
    padding: 2rem; 
    border-radius: 2.5rem; 
}


.label { 
    font-size: 0.7rem; 
    font-weight: 900; 
    color: #6b7280; 
    text-transform: uppercase; 
    letter-spacing: 0.2em; 
    margin: 0; 
}



/* Calendar Header */
.cal-header { 
    padding: 3rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid rgba(168, 85, 247, 0.1); 
}


.month-title { 
    font-size: 4rem; 
    font-weight: 900; 
    margin: 0; 
}

.year-subtitle { 
    letter-spacing: 0.5em; 
    color: var(--primary-purple); 
    font-weight: 900;
    margin: 0; 
}


/* Modal Styles */
.modal-overlay { 
    position: fixed;
    inset: 0;
    background: rgba(2, 1, 5, 0.8);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}


.modal-content { 
    background: #0a0a0c;
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 2.5rem;
    border-radius: 2.5rem;
    width: 95%;
    max-width: 550px; /* Prevents it from being too small */
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Adds space between "crumpled" elements */
}

.modal-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-purple);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.8rem;
    display: block;
}

.input-group {
    display: flex;
    flex-direction: column;
}



.back-btn {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 110;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 1rem;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    transform: translateX(-5px);
    border-color: var(--primary-purple);
}

.today-btn {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 10px;
}

.today-btn:hover {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.today-btn:active {
    transform: translateY(0);
}

.del-btn {
    opacity: 0.5;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
}

.del-btn:hover { opacity: 1; color: #ff4444; }

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03) !important; /* Dark background */
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    padding: 1rem;
    border-radius: 1rem;
    color: white !important; /* Forces text to be white */
    font-family: inherit;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-purple) !important;
    background: rgba(168, 85, 247, 0.05) !important;
}

.time-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.time-row input, .time-row select {
    flex: 1;
    min-width: 0; /* Prevents overflow */
}

.nav-btn {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.nav-btn:hover {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
    color: white;
}

.nav-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Optional: Styling the button container */
.nav-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}



/* Priority Button Group */
.priority-button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.priority-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    font-weight: 700;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Low Priority - Purple */
.priority-btn.low.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
    color: #d8b4fe;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

/* Mid Priority - Yellow */
.priority-btn.mid.active {
    background: rgba(234, 179, 8, 0.2);
    border-color: #eab308;
    color: #fef08a;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.3);
}

/* High Priority - Red */
.priority-btn.high.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fecaca;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.priority-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.reminder-chip.low { border-left-color: #a855f7; background: rgba(168, 85, 247, 0.1); }
.reminder-chip.mid { border-left-color: #eab308; background: rgba(234, 179, 8, 0.1); }
.reminder-chip.high { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.1); }


.smart-input-container {
    margin-bottom: 1.5rem;
    padding: 0.8rem !important;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.smart-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sparkle-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px #a855f7);
}

.smart-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    outline: none;
    padding: 8px 0;
}

.smart-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.smart-btn {
    background: var(--primary-purple);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

/* Toggle Button Styling */
.theme-toggle {

    position: fixed; /* Fixes it to the viewport */
    top: 2rem;       /* Distance from top */
    right: 2rem;     /* Distance from right */
    z-index: 1000;

    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}



.theme-toggle svg { width: 20px; height: 20px; }

/* Light Mode Overrides */
body.light-mode {
    background: #f8fafc; /* Light grey/white background */
    color: #1e293b;
}

body.light-mode .glass-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body.light-mode .month-title, 
body.light-mode .label,
body.light-mode .date-number {
    color: #1e293b !important;
}

body.light-mode .theme-toggle {
    background: white;
    color: #a855f7;
    border-color: #a855f7;
}

body.light-mode .smart-input {
    color: #1e293b;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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