/* =========================================================
   EduBuddy - Main Stylesheet
   ========================================================= */


/* =========================================================
   GLOBAL
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;

    background: #f4f7fb;
    color: #172033;
    min-height: 100vh;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

input,
textarea,
select {
    outline: none;
}


/* =========================================================
   WELCOME SCREEN
   ========================================================= */

.welcome-screen {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(67, 97, 238, 0.20),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(118, 75, 162, 0.18),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #eef3ff,
            #f8faff
        );
}

.welcome-container {
    width: min(680px, 100%);

    padding: 65px 45px;

    text-align: center;

    background: rgba(255, 255, 255, 0.90);

    border: 1px solid rgba(255, 255, 255, 0.8);

    border-radius: 28px;

    box-shadow:
        0 25px 70px rgba(31, 48, 90, 0.13);

    backdrop-filter: blur(12px);
}

.welcome-logo,
.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
        135deg,
        #315efb,
        #6846d9
    );

    color: white;

    font-weight: 800;

    box-shadow:
        0 10px 25px rgba(49, 94, 251, 0.25);
}

.welcome-logo {
    width: 82px;
    height: 82px;

    margin: 0 auto 24px;

    border-radius: 24px;

    font-size: 26px;
}

.welcome-small {
    color: #5267a5;

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 2px;

    margin-bottom: 12px;
}

.welcome-container h1 {
    font-size: clamp(36px, 6vw, 58px);

    line-height: 1.1;

    margin-bottom: 20px;
}

.welcome-container h1 span {
    color: #315efb;
}

.welcome-description {
    max-width: 540px;

    margin: 0 auto 32px;

    color: #68748a;

    font-size: 16px;

    line-height: 1.7;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.primary-btn,
.secondary-btn,
.back-home-btn {
    border: none;

    border-radius: 12px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.primary-btn {
    padding: 12px 20px;

    color: white;

    background: linear-gradient(
        135deg,
        #315efb,
        #6846d9
    );

    box-shadow:
        0 8px 20px rgba(49, 94, 251, 0.20);

    font-weight: 700;
}

.primary-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(49, 94, 251, 0.28);
}

.secondary-btn {
    padding: 12px 20px;

    color: #315efb;

    background: #edf2ff;

    font-weight: 700;
}

.secondary-btn:hover {
    background: #e1e9ff;
}

.welcome-btn {
    min-width: 190px;

    padding: 15px 28px;

    border-radius: 14px;

    font-size: 16px;
}


/* =========================================================
   APPLICATION LAYOUT
   ========================================================= */

.app-layout {
    min-height: 100vh;

    display: flex;

    background: #f4f7fb;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: 255px;

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    display: flex;
    flex-direction: column;

    padding: 22px 16px;

    background: #ffffff;

    border-right: 1px solid #e7ebf3;

    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 5px 8px 24px;
}

.brand-logo {
    width: 45px;
    height: 45px;

    flex-shrink: 0;

    border-radius: 13px;

    font-size: 14px;
}

.sidebar-brand h2 {
    font-size: 18px;

    line-height: 1.2;
}

.sidebar-brand span {
    display: block;

    margin-top: 3px;

    color: #8a94a7;

    font-size: 11px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;

    gap: 5px;
}

.nav-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px 13px;

    border: none;
    border-radius: 12px;

    background: transparent;

    color: #667085;

    text-align: left;

    font-size: 14px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.nav-item:hover {
    background: #f1f4fb;

    color: #315efb;
}

.nav-item.active {
    background: #edf2ff;

    color: #315efb;

    font-weight: 700;
}

.nav-icon {
    width: 25px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    font-size: 16px;
}

.sidebar-bottom {
    margin-top: auto;

    padding-top: 20px;

    border-top: 1px solid #edf0f5;
}

.back-home-btn {
    width: 100%;

    padding: 11px 14px;

    background: #f5f7fb;

    color: #657086;

    font-size: 13px;

    font-weight: 700;
}

.back-home-btn:hover {
    background: #edf2ff;

    color: #315efb;
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main-content {
    width: calc(100% - 255px);

    margin-left: 255px;

    min-height: 100vh;

    padding: 0 34px 50px;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    min-height: 86px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-bottom: 1px solid #e7ebf3;
}

.topbar h1 {
    font-size: 25px;

    line-height: 1.2;
}

.topbar p {
    margin-top: 5px;

    color: #7b8497;

    font-size: 13px;
}

.topbar-date {
    min-width: 125px;

    padding: 10px 14px;

    background: white;

    border: 1px solid #e7ebf3;

    border-radius: 12px;

    text-align: right;
}

.topbar-date span {
    display: block;

    color: #9099aa;

    font-size: 10px;

    text-transform: uppercase;

    letter-spacing: 0.7px;
}

.topbar-date strong {
    display: block;

    margin-top: 3px;

    color: #315efb;

    font-size: 12px;
}


/* =========================================================
   PAGE SYSTEM
   ========================================================= */

.page {
    display: none;

    padding-top: 30px;

    animation: pageFade 0.25s ease;
}

.page.active-page {
    display: block;
}

@keyframes pageFade {

    from {
        opacity: 0;

        transform: translateY(5px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }

}


/* =========================================================
   SECTION LABEL
   ========================================================= */

.section-label {
    color: #315efb;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1.4px;

    margin-bottom: 7px;
}


/* =========================================================
   DASHBOARD WELCOME
   ========================================================= */

.dashboard-welcome {
    min-height: 190px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    padding: 30px 34px;

    border-radius: 22px;

    background:
        linear-gradient(
            135deg,
            #eaf0ff,
            #f7f4ff
        );

    border: 1px solid #e1e7fa;

    overflow: hidden;
}

.dashboard-welcome h2 {
    font-size: clamp(25px, 3vw, 35px);

    margin-bottom: 10px;
}

.dashboard-welcome p:not(.section-label) {
    color: #6d7890;

    line-height: 1.6;
}

.dashboard-emoji {
    width: 110px;
    height: 110px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 30px;

    background: rgba(255, 255, 255, 0.75);

    font-size: 52px;

    box-shadow:
        0 15px 35px rgba(60, 80, 130, 0.10);
}


/* =========================================================
   STATISTICS
   ========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-top: 20px;
}

.stat-card {
    display: flex;
    align-items: center;

    gap: 13px;

    padding: 18px;

    background: #ffffff;

    border: 1px solid #e7ebf3;

    border-radius: 16px;

    box-shadow:
        0 5px 18px rgba(30, 45, 80, 0.04);
}

.stat-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #edf2ff;

    font-size: 19px;
}

.stat-card span {
    display: block;

    color: #8993a5;

    font-size: 11px;
}

.stat-card strong {
    display: block;

    margin-top: 3px;

    color: #202b3f;

    font-size: 21px;
}


/* =========================================================
   DASHBOARD GRID
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;

    margin-top: 20px;
}


/* =========================================================
   CARDS
   ========================================================= */

.dashboard-card,
.content-card {
    background: #ffffff;

    border: 1px solid #e7ebf3;

    border-radius: 18px;

    box-shadow:
        0 5px 20px rgba(30, 45, 80, 0.04);
}

.dashboard-card {
    padding: 22px;
}

.content-card {
    padding: 24px;

    margin-top: 18px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 17px;
}

.card-header h3 {
    font-size: 16px;
}

.card-header p {
    margin-top: 4px;

    color: #8993a5;

    font-size: 12px;
}

.card-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 11px;

    background: #edf2ff;

    font-size: 17px;
}


/* =========================================================
   FORM ELEMENTS
   ========================================================= */

input,
textarea,
select {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #dfe4ed;

    border-radius: 11px;

    background: #ffffff;

    color: #202b3f;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: #a2aaba;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #7190ff;

    box-shadow:
        0 0 0 3px rgba(49, 94, 251, 0.09);
}

textarea {
    min-height: 120px;

    resize: vertical;

    line-height: 1.6;
}

.dashboard-card input {
    margin-bottom: 10px;
}

.dashboard-card textarea {
    min-height: 95px;

    margin-bottom: 10px;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 29px;

    margin-bottom: 6px;
}

.page-header p:not(.section-label) {
    color: #7d8799;

    font-size: 13px;

    line-height: 1.6;
}

.large-icon {
    width: 65px;
    height: 65px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 19px;

    background: #edf2ff;

    font-size: 29px;
}


/* =========================================================
   FORM GRID
   ========================================================= */

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 17px;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.form-group label {
    color: #4c576b;

    font-size: 12px;

    font-weight: 700;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group textarea {
    min-height: 125px;
}

.button-row {
    display: flex;

    gap: 10px;

    margin-top: 15px;
}


/* =========================================================
   CARD TITLE ROW
   ========================================================= */

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 15px;
}

.card-title-row h3 {
    font-size: 16px;
}

.card-title-row span {
    color: #8b95a7;

    font-size: 11px;
}


/* =========================================================
   NOTES
   ========================================================= */

.notes-list {
    display: flex;
    flex-direction: column;

    gap: 11px;
}

.note-item {
    position: relative;

    padding: 15px 45px 15px 15px;

    background: #f8faff;

    border: 1px solid #e6ebf7;

    border-radius: 12px;

    line-height: 1.6;

    white-space: pre-wrap;
}

.note-item small {
    display: block;

    margin-top: 7px;

    color: #9099aa;

    font-size: 10px;
}

.delete-btn {
    position: absolute;

    top: 10px;
    right: 10px;

    width: 28px;
    height: 28px;

    border: none;

    border-radius: 8px;

    background: #fff0f0;

    color: #e05a5a;

    font-size: 14px;
}

.delete-btn:hover {
    background: #ffe1e1;
}


/* =========================================================
   ROUTINE / TASKS
   ========================================================= */

.tasks-list {
    display: flex;
    flex-direction: column;

    gap: 11px;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 15px;

    background: #f8faff;

    border: 1px solid #e6ebf7;

    border-radius: 12px;
}

.task-info strong {
    display: block;

    font-size: 14px;
}

.task-info span {
    display: block;

    margin-top: 5px;

    color: #7f899b;

    font-size: 11px;
}


/* =========================================================
   QUOTE
   ========================================================= */

.quote-box {
    min-height: 95px;

    display: flex;
    align-items: center;

    padding: 18px;

    border-radius: 13px;

    background: #f5f7ff;

    color: #55627a;

    font-size: 14px;

    line-height: 1.7;

    font-style: italic;
}


/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.quick-actions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 9px;
}

.quick-actions button {
    padding: 12px;

    border: 1px solid #e4e9f2;

    border-radius: 11px;

    background: #f8faff;

    color: #536078;

    font-size: 12px;

    font-weight: 700;

    text-align: left;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.quick-actions button:hover {
    background: #edf2ff;

    border-color: #d4defe;

    color: #315efb;
}


/* =========================================================
   CHAT
   ========================================================= */

.chat-container {
    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e7ebf3;

    border-radius: 18px;

    box-shadow:
        0 5px 20px rgba(30, 45, 80, 0.04);
}

.chat-messages {
    min-height: 430px;
    max-height: 500px;

    overflow-y: auto;

    display: flex;
    flex-direction: column;

    gap: 12px;

    padding: 22px;

    background: #f8faff;
}

.bot-message,
.user-message {
    max-width: 78%;

    padding: 12px 15px;

    border-radius: 14px;

    line-height: 1.6;

    font-size: 13px;
}

.bot-message {
    align-self: flex-start;

    background: white;

    border: 1px solid #e3e8f1;
}

.user-message {
    align-self: flex-end;

    background: #315efb;

    color: white;
}

.bot-message strong,
.user-message strong {
    display: block;

    margin-bottom: 4px;

    font-size: 11px;
}

.chat-input-area {
    display: grid;

    grid-template-columns:
        140px 1fr auto;

    gap: 9px;

    padding: 15px;

    border-top: 1px solid #e7ebf3;
}


/* =========================================================
   AI
   ========================================================= */

.ai-result-container {
    margin-top: 18px;
}

.ai-result-card {
    padding: 22px;

    background:
        linear-gradient(
            135deg,
            #edf2ff,
            #f7f2ff
        );

    border: 1px solid #dce4ff;

    border-radius: 18px;
}

.ai-result-card h3 {
    margin-bottom: 15px;

    font-size: 18px;
}

.ai-result-card p {
    margin: 9px 0;

    color: #59667c;

    font-size: 13px;
}

.ai-result-card strong {
    color: #253149;
}

.ai-result-card small {
    display: block;

    margin-top: 13px;

    color: #7c8799;

    line-height: 1.5;
}

.ai-history {
    display: flex;
    flex-direction: column;

    gap: 10px;
}

.ai-history-item {
    display: grid;

    grid-template-columns:
        1.5fr 1fr 1fr 1fr;

    gap: 12px;

    padding: 13px;

    background: #f8faff;

    border: 1px solid #e6ebf7;

    border-radius: 11px;

    font-size: 12px;
}

.ai-history-item span {
    color: #69758a;
}


/* =========================================================
   RESUME
   ========================================================= */

.resume-output {
    margin-top: 18px;
}

.resume-paper {
    max-width: 850px;

    margin: 0 auto;

    padding: 45px;

    background: white;

    border: 1px solid #e2e6ee;

    border-radius: 8px;

    box-shadow:
        0 8px 30px rgba(30, 45, 80, 0.07);
}

.resume-paper h1 {
    margin-bottom: 7px;

    font-size: 30px;
}

.resume-contact {
    margin-bottom: 25px;

    color: #6e788a;

    font-size: 12px;
}

.resume-section {
    margin-top: 22px;
}

.resume-section h3 {
    padding-bottom: 7px;

    border-bottom: 2px solid #315efb;

    color: #315efb;

    font-size: 14px;

    text-transform: uppercase;

    letter-spacing: 0.7px;
}

.resume-section p {
    margin-top: 10px;

    color: #4e596c;

    font-size: 13px;

    line-height: 1.7;

    white-space: pre-wrap;
}


/* =========================================================
   SUMMARY
   ========================================================= */

.summary-input {
    min-height: 260px;
}

.summary-output {
    min-height: 150px;

    padding: 18px;

    border-radius: 12px;

    background: #f8faff;

    border: 1px solid #e5eaf3;

    color: #566177;

    line-height: 1.8;

    font-size: 14px;

    white-space: pre-wrap;
}

.empty-state {
    padding: 25px;

    color: #9aa3b2;

    text-align: center;

    font-size: 13px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 1000px) {

    .sidebar {
        width: 220px;
    }

    .main-content {
        width: calc(100% - 220px);

        margin-left: 220px;

        padding-left: 24px;
        padding-right: 24px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 760px) {

    .app-layout {
        display: block;
    }

    .sidebar {
        width: 100%;

        position: static;

        min-height: auto;

        padding: 12px;

        border-right: none;

        border-bottom: 1px solid #e7ebf3;
    }

    .sidebar-brand {
        padding-bottom: 12px;
    }

    .sidebar-nav {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .sidebar-bottom {
        padding-top: 10px;
    }

    .main-content {
        width: 100%;

        margin-left: 0;

        padding: 0 15px 35px;
    }

    .topbar {
        min-height: 75px;
    }

    .topbar h1 {
        font-size: 21px;
    }

    .topbar-date {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-welcome {
        padding: 24px;

        min-height: 160px;
    }

    .dashboard-emoji {
        width: 70px;
        height: 70px;

        font-size: 34px;

        border-radius: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }

    .chat-input-area {
        grid-template-columns: 1fr;
    }

    .ai-history-item {
        grid-template-columns: 1fr 1fr;
    }

}


@media (max-width: 500px) {

    .welcome-screen {
        padding: 15px;
    }

    .welcome-container {
        padding: 45px 23px;

        border-radius: 22px;
    }

    .welcome-container h1 {
        font-size: 36px;
    }

    .welcome-description {
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-welcome {
        align-items: flex-start;
    }

    .dashboard-emoji {
        display: none;
    }

    .page-header {
        align-items: flex-start;
    }

    .page-header h2 {
        font-size: 24px;
    }

    .large-icon {
        width: 50px;
        height: 50px;

        font-size: 22px;
    }

    .content-card {
        padding: 17px;
    }

    .dashboard-card {
        padding: 17px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .ai-history-item {
        grid-template-columns: 1fr;
    }

    .resume-paper {
        padding: 25px 18px;
    }

}
