* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}
label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}
body,
.container,
.subject-box,
.plan-card,
.day-card,
.dashboard-card,
.modal-content,
input,
select,
textarea,
button {
    transition: all 0.3s ease;
}
body {
    min-height: 100vh;
    justify-content: center;
    align-items: center;

    background: linear-gradient(
        135deg,
        #e8f0ff,
        #dfe9f7
    );

    padding: 30px;
}

.container {
    width: 100%;
    max-width: 900px;

    background: white;

    padding: 50px;

    border-radius: 24px;

    box-shadow:
        0 20px 40px rgba(0,0,0,0.08);
}

.logo {
    font-size: 50px;
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    text-align: center;
    color: #1e293b;
    font-size: 48px;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 35px;
    font-size: 18px;
}
input {
    width: 100%;

    padding: 16px 18px;

    margin-bottom: 20px;

    border: 2px solid #dbeafe;

    border-radius: 14px;

    font-size: 16px;

    transition: 0.3s;
}

input:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 4px rgba(37,99,235,0.15);
}

button {
    width: 100%;

    padding: 18px;

    border: none;

    border-radius: 14px;

    background: #2563eb;

    color: white;

    font-size: 18px;
    font-weight: bold;

    cursor: pointer;

    transition: 0.3s;

    margin-top: 10px;
}

button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

#result {
    margin-top: 35px;
}

#result h2 {
    text-align: center;
    color: #1e293b;
    margin-bottom: 20px;
}
@media (max-width: 768px) {

    .container {
        padding: 25px;
    }

    h1 {
        font-size: 34px;
    }

    .logo {
        font-size: 40px;
    }
    body {
    padding: 15px;
}

button {
    font-size: 16px;
}

#themeToggle {
    font-size: 14px;
    padding: 8px 14px;
}
}
select {
    width: 100%;

    padding: 16px;

    margin-bottom: 20px;

    border: 2px solid #dbeafe;

    border-radius: 14px;

    font-size: 16px;
}
.subject-box {
    background: #f8fbff;
    border: 1px solid #dbeafe;

    padding: 20px;

    margin-top: 15px;
    margin-bottom: 25px;

    border-radius: 16px;

    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.subject-box label {
    display: block;

    margin-bottom: 8px;

    font-weight: 600;

    color: #334155;
}
.subject-box input,
.subject-box select {
    margin-bottom: 16px;
}
.subject-title {
    margin-top: 25px;

    margin-bottom: 10px;

    color: #1e3a8a;

    font-size: 22px;
}
.progress-container {
    margin: 20px 0;
}

.progress-text {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 18px;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        #3b82f6,
        #60a5fa
    );
    border-radius: 999px;
    transition: width 0.4s ease;
}
.plan-card {
    display: flex;

    justify-content: space-between;

    align-items: center;

    background: white;

    padding: 18px;

    margin-top: 12px;

    border-radius: 14px;

    border-left: 5px solid #2563eb;

    box-shadow:
        0 4px 10px rgba(0,0,0,0.05);

    transition: transform 0.3s ease;
}
.plan-card:hover {
    transform: translateY(-3px);
}
.plan-left {
    display: flex;

    align-items: center;

    gap: 12px;
}
.task-badge {
    background: #dbeafe;

    color: #1d4ed8;

    padding: 6px 12px;

    border-radius: 30px;

    font-size: 13px;

    font-weight: bold;
}
.task-checkbox {
    width: 18px;

    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}
.task-text {
    font-weight: 500;
    word-break: break-word;
    color: #1e293b;
    font-size: 1rem;
}
.completed-badge {

    background: #dcfce7;

    color: #15803d;

}
.loading-card {

    margin-top: 20px;

    padding: 20px;

    background: white;

    border-radius: 14px;

    text-align: center;

    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.spinner {

    width: 40px;

    height: 40px;

    margin: 0 auto 15px;

    border: 4px solid #dbeafe;

    border-top: 4px solid #2563eb;

    border-radius: 50%;

    animation: spin 1s linear infinite;
}

@keyframes spin {

    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
.day-card {

    margin-top: 25px;

    padding: 20px;

    background: #f8fafc;

    border-radius: 16px;

    border: 1px solid #e2e8f0;
}

.day-title {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}
/* ==========================
   Subject Workspace Modal
========================== */

.modal {

    display: none;

    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.5);

    z-index: 1000;

}

.modal-content {

    background: white;

    width: 95%;

    max-width: 700px;

    max-height: 90vh;

    overflow-y: auto;

    margin: 30px auto;

    padding: 25px;

    border-radius: 16px;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.2);

}

.close-btn {
    float: right;
    font-size: 30px;
    cursor: pointer;
    font-weight: bold;
}

.close-btn:hover {

    color: red;

}

#workspaceNotes {

    resize: vertical;

    min-height: 120px;

}

.modal-content input,
.modal-content textarea {

    padding: 10px;

    border: 1px solid #ccc;

    border-radius: 8px;

    font-size: 14px;
     width: 100%;
}

.modal-content button {

    margin-top: 10px;

}
.workspace-section {

    margin-top: 25px;

    display: flex;

    flex-direction: column;

    gap: 12px;

}

.workspace-btn {

    padding: 14px;

    border: none;

    border-radius: 10px;

    cursor: pointer;

    font-size: 16px;

    font-weight: 600;

    transition: 0.3s;

}

.workspace-btn:hover {

    transform: translateY(-2px);

}
/* ==========================
   Dashboard Cards
========================== */

.dashboard-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(120px, 1fr));

    gap: 12px;

    margin: 15px 0;

}

.dashboard-card {

    background: white;

    padding: 18px;

    border-radius: 14px;

    text-align: center;

    box-shadow:
        0 4px 10px rgba(0,0,0,0.05);

}

.dashboard-card h3 {

    color: #2563eb;

    margin-bottom: 8px;

}

.dashboard-card p {

    font-size: 24px;

    font-weight: bold;

}
.clear-btn {

    background: #ef4444;

}

.clear-btn:hover {

    background: #dc2626;

}
.workspace-btn {

    background: #2563eb;

    color: white;

}

.workspace-btn:hover {

    background: #1d4ed8;

}
@media (max-width: 768px) {

    .modal-content {

        width: 95%;

        padding: 18px;

        margin: 15px auto;

    }

    .dashboard-grid {

        grid-template-columns: 1fr;

    }

    #workspaceTitle {

        font-size: 22px;

        text-align: center;

    }

    .workspace-btn {

        font-size: 14px;

        padding: 12px;

    }

}
.resource-card {
    display: block;
    padding: 12px;
    margin-bottom: 10px;
    background: #eff6ff;
    border-radius: 10px;
    text-decoration: none;
    color: #1d4ed8;
    font-weight: 600;
    transition: 0.3s;
}

.resource-card:hover {
    transform: translateY(-2px);
}
#themeToggle {

    width: auto;
    padding: 10px 18px;

    background: #2563eb;
    color: white;

    border: none;
    border-radius: 8px;

    cursor: pointer;
}
@media (max-width: 768px) {

    .header-actions {
        position: static;
        width: 100%;
        margin-bottom: 15px;
    }

}
.dark-mode {
    background: #0b1736;
    color: #ffffff;
}

.dark-mode .container {
    background: #1e2b47;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode p,
.dark-mode label {
    color: #ffffff !important;
}

.dark-mode .subtitle {
    color: #cbd5e1 !important;
}

.dark-mode input,
.dark-mode select,
.dark-mode textarea {
    background: #334155;
    color: #ffffff;
    border: 1px solid #475569;
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: #cbd5e1;
}

.dark-mode .subject-box,
.dark-mode .plan-card,
.dark-mode .dashboard-card,
.dark-mode .modal-content,
.dark-mode .day-card {
    background: #293548;
    color: #ffffff;
}
.dark-mode .resource-card {
    background: #1e40af;
    color: white;
}
.dark-mode .day-title {
    color: #60a5fa;
}
.dark-mode .progress-bar {
    background: #475569;
}
.dark-mode .task-text {
    color: #ffffff;
}
.dark-mode .footer {
    color: #cbd5e1;
}
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #64748b;
    font-size: 14px;
    width: 100%;
}
.modal-content {
    animation: modalFade 0.25s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.page-wrapper {
    max-width: 900px;
    margin: 0 auto;
}
body.dark-mode {
    background: linear-gradient(
        180deg,
        #0f172a,
        #1e293b
    );
}
.goal-card,
.ai-card,
.forecast-card {
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
}

.goal-card h4,
.ai-card h4,
.forecast-card h4 {
    margin-bottom: 8px;
}
@media (max-width: 768px) {

    body {
        padding: 10px;
    }

    .container {
        width: 100%;
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
        text-align: center;
    }

    h2 {
        font-size: 1.4rem;
    }

    input,
    select,
    textarea,
    button {
        width: 100%;
        font-size: 16px;
    }

    .plan-card,
    .workspace-modal,
    .subject-card {
        width: 100%;
        box-sizing: border-box;
    }

    .progress-container {
        width: 100%;
    }

    .footer {
        text-align: center;
    }
}
button {
    width: 100%;
    max-width: 100%;
}
.plan-card {
    width: 100%;
    box-sizing: border-box;
}
.controls {
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        width: 100%;
    }

    .controls select,
    .controls button {
        width: 100%;
    }
}
@media (max-width: 768px) {

    .plan-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
    }

    .plan-left {
        width: 100%;
    }

    .task-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px;
        width: 100%;
    }

    .task-item {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        border-radius: 10px;
        background: rgba(255,255,255,0.05);
    }

    .task-checkbox {
        flex-shrink: 0;
    }

    .task-text {
        white-space: normal;
        word-break: break-word;
    }
}
@media (max-width: 768px) {

    .day-title {
        font-size: 1.4rem;
    }

}
/* ==========================
   Mobile Fix
========================== */

@media (max-width: 768px) {

    .plan-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .plan-card h4 {
        width: 100%;
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .plan-left {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .task-text {
        font-size: 15px;
        white-space: normal;
        word-break: break-word;
        color: inherit;
    }

    .task-checkbox {
        width: 18px;
        height: 18px;
        margin: 0;
        flex-shrink: 0;
    }

}
@media (max-width: 768px) {

    .day-title {
        font-size: 1.4rem;
    }

}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.task-counter {
    background: rgba(255,255,255,0.08);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        #22c55e,
        #16a34a
    );
    border-radius: 20px;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    transition: 0.4s ease;
}

.progress-milestones {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 12px;
    text-align: center;
}

.progress-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
}
.ai-tips-box{
    margin:20px 0;
    padding:20px;
    border-radius:16px;
    background:rgba(255,255,255,0.05);
    border:1px solid rgba(255,255,255,0.1);
}

.ai-tips-box h3{
    margin-bottom:10px;
}

.ai-tips-box pre{
    white-space:pre-wrap;
    line-height:1.6;
    font-family:inherit;
}
