/* =========================================
   STUDENT TASKPILOT
   PREMIUM GLASSMORPHISM UI
========================================= */

:root{
    --bg:#F8FAFF;
    --primary:#7C8CFF;
    --secondary:#A78BFA;
    --accent:#5EEAD4;
    --text:#1E293B;
    --card-bg:rgba(255,255,255,0.65);
    --border:rgba(255,255,255,0.45);
    --shadow:0 10px 30px rgba(0,0,0,0.08);
}

/* DARK MODE */

body.dark{
    --bg:#0F172A;
    --text:#E2E8F0;
    --card-bg:rgba(15,23,42,0.70);
    --border:rgba(255,255,255,0.08);
    --shadow:0 12px 30px rgba(0,0,0,0.45);
}

/* =========================================
   RESET
========================================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:'Poppins',sans-serif;
    background:linear-gradient(
        135deg,
        #F8FAFF,
        #EEF2FF,
        #F5F3FF
    );
    min-height:100vh;
    color:var(--text);
    transition:.3s ease;
    padding-bottom:90px;
}

body.dark{
    background:
    linear-gradient(
        135deg,
        #020617,
        #0F172A,
        #111827
    );
}

img{
    max-width:100%;
}

button,
input,
textarea,
select{
    font-family:inherit;
}

/* =========================================
   UTILITIES
========================================= */

.hidden{
    display:none !important;
}

.section{
    display:none;
}

.active-section{
    display:block;
}

.glass{
    background:var(--card-bg);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    border:1px solid var(--border);
    box-shadow:var(--shadow);
}

.primary-btn{
    border:none;
    cursor:pointer;
    padding:14px 24px;
    border-radius:16px;
    background:linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color:white;
    font-weight:600;
    transition:.3s;
}

.primary-btn:hover{
    transform:translateY(-3px);
}

.secondary-btn{
    border:none;
    cursor:pointer;
    padding:14px 24px;
    border-radius:16px;
    background:#CBD5E1;
    font-weight:600;
}

.danger-btn{
    border:none;
    cursor:pointer;
    padding:14px 24px;
    border-radius:16px;
    background:#EF4444;
    color:white;
    font-weight:600;
}

/* =========================================
   WELCOME SCREEN
========================================= */

.welcome-screen{
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:24px;
}

.welcome-card{
    width:100%;
    max-width:430px;
    padding:40px 30px;
    border-radius:30px;
    text-align:center;
}

.logo-box{
    width:90px;
    height:90px;
    margin:auto;
    border-radius:24px;
    background:linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:34px;
    margin-bottom:20px;
}

.welcome-card h1{
    font-size:2rem;
    margin-bottom:12px;
}

.welcome-card p{
    opacity:.8;
    margin-bottom:28px;
    line-height:1.7;
}

.feature-grid{
    margin-top:30px;
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:16px;
}

.feature-item{
    padding:18px;
    border-radius:18px;
    background:rgba(255,255,255,0.35);
}

.feature-item i{
    display:block;
    margin-bottom:10px;
    color:var(--primary);
    font-size:20px;
}

/* =========================================
   APP CONTAINER
========================================= */

#app-container{
    width:100%;
    max-width:1200px;
    margin:auto;
    padding:20px;
}

/* =========================================
   HEADER
========================================= */

.top-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 22px;
    border-radius:24px;
    margin-bottom:20px;
}

.top-header h2{
    font-size:1.4rem;
}

.top-header p{
    opacity:.7;
    margin-top:4px;
}

.theme-btn{
    width:52px;
    height:52px;
    border:none;
    border-radius:50%;
    cursor:pointer;
    background:linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color:white;
    font-size:18px;
}

/* =========================================
   DASHBOARD
========================================= */

.quote-card{
    border-radius:24px;
    padding:24px;
    margin-bottom:22px;
}

.quote-card h3{
    margin-bottom:12px;
}

.quote-card p{
    line-height:1.8;
    font-style:italic;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:16px;
    margin-bottom:24px;
}

.stat-card{
    border-radius:24px;
    padding:24px;
    text-align:center;
}

.stat-card i{
    font-size:28px;
    margin-bottom:12px;
    color:var(--primary);
}

.stat-card h3{
    font-size:1.7rem;
}

.stat-card p{
    margin-top:6px;
    opacity:.7;
}

/* =========================================
   PROGRESS RING
========================================= */

.progress-wrapper{
    border-radius:30px;
    padding:30px;
    text-align:center;
}

.progress-wrapper h3{
    margin-bottom:24px;
}

.progress-ring{
    position:relative;
    width:180px;
    height:180px;
    margin:auto;
}

.progress-ring svg{
    transform:rotate(-90deg);
}

.ring-bg{
    fill:none;
    stroke:#E2E8F0;
    stroke-width:12;
}

.ring-progress{
    fill:none;
    stroke:var(--primary);
    stroke-width:12;
    stroke-linecap:round;
    stroke-dasharray:471;
    stroke-dashoffset:471;
    transition:.5s ease;
}

.ring-text{
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    font-size:1.8rem;
    font-weight:700;
}

/* =========================================
   SECTION TITLES
========================================= */

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

.section-header h2{
    font-size:1.6rem;
}

/* =========================================
   FORMS
========================================= */

input,
textarea,
select{
    width:100%;
    border:none;
    outline:none;
    padding:15px;
    border-radius:16px;
    background:rgba(255,255,255,.55);
    margin-top:12px;
    color:var(--text);
}

body.dark input,
body.dark textarea,
body.dark select{
    background:rgba(255,255,255,.05);
    color:white;
}

textarea{
    resize:none;
}

/* =========================================
   CARDS
========================================= */

.task-form,
.goal-card,
.timer-card,
.notes-card{
    border-radius:26px;
    padding:22px;
}
/* =========================================
   TASK MANAGER
========================================= */

.search-box{
    padding:18px;
    border-radius:24px;
    margin:18px 0;
}

#taskList{
    list-style:none;
    display:flex;
    flex-direction:column;
    gap:14px;
}

.task-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:18px;
    border-radius:22px;
    background:rgba(255,255,255,0.55);
    backdrop-filter:blur(14px);
    box-shadow:var(--shadow);
    animation:fadeUp .3s ease;
}

body.dark .task-item{
    background:rgba(255,255,255,0.05);
}

.task-left{
    display:flex;
    align-items:center;
    gap:12px;
    flex:1;
}

.task-checkbox{
    width:20px;
    height:20px;
    cursor:pointer;
}

.task-content{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.task-text{
    font-weight:500;
    word-break:break-word;
}

.task-completed{
    text-decoration:line-through;
    opacity:.6;
}

.priority{
    padding:4px 10px;
    border-radius:999px;
    font-size:.75rem;
    font-weight:600;
}

.priority.high{
    background:#FEE2E2;
    color:#DC2626;
}

.priority.medium{
    background:#FEF3C7;
    color:#D97706;
}

.priority.low{
    background:#DCFCE7;
    color:#16A34A;
}

.task-actions{
    display:flex;
    gap:10px;
}

.delete-btn{
    border:none;
    width:42px;
    height:42px;
    border-radius:12px;
    cursor:pointer;
    background:#EF4444;
    color:#fff;
}

/* =========================================
   GOAL TRACKER
========================================= */

.goal-card{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-bottom:20px;
}

.goal-progress{
    border-radius:24px;
    padding:22px;
    margin-bottom:18px;
}

.goal-progress h4{
    margin-bottom:14px;
}

.progress-bar{
    width:100%;
    height:16px;
    border-radius:999px;
    overflow:hidden;
    background:#E2E8F0;
}

.progress-bar div{
    height:100%;
    width:0%;
    border-radius:999px;
    transition:.5s ease;
    background:linear-gradient(
        90deg,
        var(--primary),
        var(--accent)
    );
}

.goal-progress span{
    display:block;
    margin-top:10px;
    font-weight:600;
}

/* =========================================
   POMODORO TIMER
========================================= */

.timer-card{
    text-align:center;
}

#timerDisplay{
    font-size:4rem;
    font-weight:700;
    margin:25px 0;
    color:var(--primary);
}

.timer-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    justify-content:center;
}

.session-box{
    margin-top:24px;
    font-size:1.1rem;
    font-weight:600;
}

/* =========================================
   NOTES
========================================= */

.notes-card{
    display:flex;
    flex-direction:column;
    gap:16px;
}

#notesArea{
    min-height:280px;
    line-height:1.8;
    font-size:1rem;
}

/* =========================================
   ACHIEVEMENTS
========================================= */

.achievement-section{
    margin-top:24px;
}

.achievement-card{
    border-radius:28px;
    padding:24px;
}

.achievement-card h3{
    margin-bottom:16px;
}

#achievementContainer{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.badge{
    padding:10px 16px;
    border-radius:999px;
    background:linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color:white;
    font-weight:600;
    font-size:.9rem;
}

/* =========================================
   BOTTOM NAVIGATION
========================================= */

.bottom-nav{
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    height:78px;
    background:rgba(255,255,255,.8);
    backdrop-filter:blur(20px);
    display:flex;
    justify-content:space-around;
    align-items:center;
    border-top:1px solid rgba(255,255,255,.4);
    z-index:1000;
}

body.dark .bottom-nav{
    background:rgba(15,23,42,.85);
}

.nav-btn{
    border:none;
    background:none;
    cursor:pointer;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:5px;
    color:var(--text);
    transition:.3s;
}

.nav-btn i{
    font-size:1.15rem;
}

.nav-btn span{
    font-size:.75rem;
}

.nav-btn.active{
    color:var(--primary);
    transform:translateY(-3px);
}

/* =========================================
   TOAST
========================================= */

#toast{
    position:fixed;
    top:20px;
    right:20px;
    background:linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color:white;
    padding:14px 20px;
    border-radius:14px;
    font-weight:600;
    box-shadow:0 10px 25px rgba(0,0,0,.2);
    opacity:0;
    pointer-events:none;
    transform:translateY(-20px);
    transition:.3s;
    z-index:9999;
}

#toast.show{
    opacity:1;
    transform:translateY(0);
}

/* =========================================
   LOADING ANIMATION
========================================= */

.loading-spinner{
    width:50px;
    height:50px;
    border-radius:50%;
    border:5px solid rgba(255,255,255,.2);
    border-top-color:var(--primary);
    animation:spin 1s linear infinite;
}

/* =========================================
   HOVER EFFECTS
========================================= */

.stat-card,
.goal-progress,
.quote-card,
.progress-wrapper,
.task-item,
.notes-card,
.timer-card,
.achievement-card{
    transition:.3s ease;
}

.stat-card:hover,
.goal-progress:hover,
.quote-card:hover,
.progress-wrapper:hover,
.task-item:hover,
.notes-card:hover,
.timer-card:hover,
.achievement-card:hover{
    transform:translateY(-4px);
}

.primary-btn:hover,
.secondary-btn:hover,
.danger-btn:hover{
    transform:translateY(-2px);
    opacity:.95;
}

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

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

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

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

.progress-ring{
    animation:pulse 3s infinite;
}

/* =========================================
   DARK MODE IMPROVEMENTS
========================================= */

body.dark .feature-item,
body.dark .search-box{
    background:rgba(255,255,255,.05);
}

body.dark .priority.high{
    background:rgba(220,38,38,.15);
}

body.dark .priority.medium{
    background:rgba(245,158,11,.15);
}

body.dark .priority.low{
    background:rgba(22,163,74,.15);
}

body.dark .ring-bg{
    stroke:#334155;
}

/* =========================================
   TABLET
========================================= */

@media (min-width:768px){

    .dashboard-grid{
        grid-template-columns:repeat(4,1fr);
    }

    .welcome-card{
        max-width:520px;
    }

    .goal-card{
        max-width:700px;
    }

    .notes-card{
        max-width:900px;
    }

    #notesArea{
        min-height:350px;
    }
}

/* =========================================
   DESKTOP
========================================= */

@media (min-width:1024px){

    #app-container{
        padding:30px;
    }

    .section{
        max-width:1000px;
        margin:auto;
    }

    .dashboard-grid{
        gap:20px;
    }

    .task-form{
        display:grid;
        grid-template-columns:2fr 1fr auto;
        gap:12px;
        align-items:center;
    }

    .task-form input,
    .task-form select{
        margin-top:0;
    }

    .bottom-nav{
        max-width:800px;
        left:50%;
        transform:translateX(-50%);
        border-radius:22px 22px 0 0;
    }
}

/* =========================================
   LARGE DESKTOP
========================================= */

@media (min-width:1400px){

    .section{
        max-width:1100px;
    }

    .welcome-card{
        max-width:600px;
    }

    #timerDisplay{
        font-size:5rem;
    }
}
