/* --- General Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    background-color: #FDF6F0;
    color: #3A3A3A;
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

main {
    flex: 1;
}

/* --- Navbar --- */
.navbar {
    background: linear-gradient(90deg, #A6C8CA, #E9D3FF, #F7B2BD);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.logo {
    font-weight: 700;
    font-size: 1.4rem;
    color: #3A3A3A;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.2rem;
}

.nav-links a {
    text-decoration: none;
    color: #3A3A3A;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    transition: 0.3s ease;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(180deg, #E9D3FF 0%, #FDF6F0 100%);
    border-radius: 0 0 50px 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.5rem;
}

.hero-buttons .btn {
    display: inline-block;
    background-color: #A6C8CA;
    color: #3A3A3A;
    padding: 0.8rem 1.5rem;
    margin: 0.5rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s ease;
}

.hero-buttons .btn:hover {
    background-color: #F7B2BD;
    transform: translateY(-3px);
}

/* --- DASHBOARD LAYOUT --- */
.dashboard {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
}

.dashboard-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1000px;
}

/* --- CARD SECTIONS --- */
.dashboard-section {
    flex: 1 1 400px;
    max-width: 450px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.dashboard-section h2 {
    color: #A6C8CA;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    text-align:center;
}

/* --- NOTES GRID --- */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    align-items: start; /* prevents taller cards from stretching others */
}


/* --- TO-DO GRID --- */
.todo-grid {
    display: grid;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* --- CARDS --- */
.note-card,
.card.todo-preview {
    background-color: #fff;
    flex: 1;
    border-radius: 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    min-height: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.note-card .note-date {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.note-card .note-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    transition: max-height 0.3s ease;
    max-height:none;
    text-align: left;
    display: block;
    line-height: 1.5;
}

/* --- Buttons --- */
.save-btn,
.add-btn,
.download-btn {
    background-color: #A6C8CA;
    color: #3A3A3A;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: 0.3s ease;
}

.save-btn:hover,
.add-btn:hover,
.download-btn:hover {
    background-color: #F7B2BD;
    transform: translateY(-2px);
}

.download-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.delete-btn {
    background-color: #FF6B6B;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.3rem 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: 0.3s ease;
}

.delete-btn:hover {
    background-color: #FF4C4C;
    transform: translateY(-2px);
}

.note-actions-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* --- Notes Page --- */
.notes-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: left;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 0.3rem;
    color: #A6C8CA;
}

.subtitle {
    color: #555;
    margin-bottom: 1.5rem;
}

.toolbar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.toolbar button {
    background-color: #E9D3FF;
    border: none;
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s ease;
}

.toolbar button:hover {
    background-color: #F7B2BD;
    transform: scale(1.1);
}

#colorPicker {
    border: none;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 10px;
}

.editor {
    border: 2px solid #A6C8CA;
    border-radius: 15px;
    padding: 1rem;
    min-height: 250px;
    background-color: #FDF6F0;
    text-align: left;
    outline: none;
    font-size: 1rem;
    transition: 0.2s ease;
}

.editor:focus {
    border-color: #F7B2BD;
    background-color: #fff;
}

.editor:empty::before {
    content: attr(placeholder);
    color: #b3b3b3;
    font-style: italic;
}

/* --- To-Do --- */
.todo-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
}

.todo-card {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    margin-bottom: 1rem;
}

.todo-date {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.todo-items,
#todoItemList {
    list-style: disc;
    text-align: left;
    margin-left: 1rem;
    padding: 5px;
}

.new-todo input[type="text"] {
    padding: 0.5rem;
    border-radius: 10px;
    border: 2px solid #A6C8CA;
    margin-right: 0.5rem;
    width: 60%;
}

/* --- Pomodoro Timer --- */
.pomodoro-container {
    text-align: center;
    margin-top: 50px;
}

.timer-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}

.timer-circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: conic-gradient(#15b2af 0deg, #f0f0f0 0deg);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(21, 178, 175, 0.3);
    transition: all 0.3s ease;
}

#time-display {
    font-size: 2.5rem;
    color: #333;
    font-weight: bold;
}

.timer-controls .btn,
.settings .btn {
    margin: 10px;
    background-color: #15b2af;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: 0.3s;
}

.timer-controls .btn:hover,
.settings .btn:hover {
    background-color: #119a98;
}

.timer-controls .btn.active {
    background-color: #119a98; 
    transform: scale(0.95);    
}

.settings {
    margin-top: 20px;
}

.settings input {
    width: 70px;
    padding: 5px;
    border-radius: 10px;
    border: 1px solid #ccc;
    text-align: center;
}

/* --- Planner / Calendar --- */
.planner-container {
    max-width: 900px;
    margin: 2rem auto;
    text-align: center;
}

.calendar {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.calendar th, .calendar td {
    border: 1px solid #ccc;
    padding: 5px;
    vertical-align: top;
    height: 120px;
    width: 14.28%;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.calendar-day {
    cursor: pointer;
    position: relative;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
    height: 20px;
}

.events-list {
    list-style: disc;
    margin: 0;
    padding-left: 15px;
    text-align: left;
    font-size: 0.9rem;
    overflow-y: auto;
    max-height: 90px;
    word-wrap: break-word;
}

.event-modal {
    display: none;
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%);
    background: #fff;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 100;
    width: 300px;
}

.event-modal textarea {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    border-radius: 10px;
    padding: 5px;
    resize: none;
}

.calendar-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 1rem;
}

.calendar-nav .btn {
    padding: 5px 10px;
}

.calendar-btn {
    display: inline-block;
    background-color: #A6C8CA;
    color: #3A3A3A;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s ease;
}

.calendar-btn:hover {
    background-color: #F7B2BD;
    transform: translateY(-2px);
}

.month-year {
    font-weight: 700;
    font-size: 1.2rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 1rem;
    background-color: #E9D3FF;
    margin-top: 3rem;
    font-size: 0.9rem;
    color: #3A3A3A;
}

/* --- Responsive Fix --- */
@media (max-width: 900px) {
    .dashboard-row {
        flex-direction: column;
        align-items: center;
    }

    .dashboard-section {
        width: 90%;
    }
}
