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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center everything including the bottom nav */
    min-height: 100vh;
    padding: 20px;
    font-size: 18px;
    /* Base font size increase */
}

.app-header {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 20px;
    padding: 10px 0;
    display: flex;
    justify-content: flex-start;
}

.back-home-btn {
    text-decoration: none;
    color: #6c5ce7;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.back-home-btn:hover {
    color: #a29bfe;
    transform: translateX(-5px);
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    /* Occupy most of the screen */
    justify-content: space-between;
    /* Push nav to bottom */
}

/* Navigation - Bottom Fixed/Sticky style behavior within container */
.app-nav {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    background: #fff;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    justify-content: center;
}

.app-nav button {
    padding: 15px 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 1.2rem;
    /* Larger buttons */
    flex: 1;
}

.app-nav button:hover {
    background-color: #f0f0f0;
}

.app-nav button.active {
    background-color: #6c5ce7;
    color: white;
}

/* Section Visibility */
.hidden {
    display: none !important;
}

/* Todo Container */
.todo-container {
    background: #ffffff;
    padding: 3rem;
    /* More padding */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    flex-grow: 1;
    /* Check this */
    overflow-y: auto;
    /* Scrollable if list is long */
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    color: #444;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    /* Larger Title */
}

/* Input Area */
.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

#todo-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    /* Thicker border */
    border-radius: 6px;
    font-size: 1.2rem;
    /* Larger text */
    outline: none;
    transition: border-color 0.3s;
}

#todo-input:focus {
    border-color: #6c5ce7;
}

#add-todo {
    padding: 15px 30px;
    background-color: #6c5ce7;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s;
    white-space: nowrap;
}

#add-todo:hover {
    background-color: #5b4bc4;
}

/* Todo List */
#todo-list {
    list-style: none;
}

#todo-list li {
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 1.2rem;
}

#todo-list li:hover {
    background: #e9ecef;
}

#todo-list li span {
    word-break: break-all;
}

/* Delete Button */
#todo-list li button {
    background-color: #ff7675;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 15px;
}

#todo-list li button:hover {
    background-color: #d63031;
}

/* Calendar Styling - Year View */
.calendar-container {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    gap: 30px;
}

.calendar-header h2 {
    font-size: 2rem;
    color: #444;
    margin: 0;
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    padding: 0 20px;
}

.calendar-header button:hover {
    color: #6c5ce7;
}

.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

/* Mini Month Card */
.month-card {
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 10px;
    background: #fafafa;
}

.month-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.2rem;
}

.month-days-header,
.month-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 1rem;
}

.month-days-header div {
    color: #888;
    font-weight: bold;
    padding-bottom: 8px;
}

.month-days-grid div {
    padding: 8px 0;
    border-radius: 50%;
    cursor: pointer;
    /* Changed from default to pointer */
    transition: background-color 0.2s;
    position: relative;
    /* For dot indicator */
}

.month-days-grid div:hover {
    background-color: #f0f0f0;
}

.month-days-grid div.today {
    background-color: #6c5ce7;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(108, 92, 231, 0.4);
}

.month-days-grid div.today:hover {
    background-color: #5b4bc4;
}

.month-days-grid div.selected {
    border: 2px solid #6c5ce7;
    font-weight: bold;
    color: #6c5ce7;
}

.month-days-grid div.selected.today {
    border: 2px solid #a29bfe;
    background-color: #6c5ce7;
    color: white;
}

/* Event indicator dot */
.month-days-grid div.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #ff7675;
    border-radius: 50%;
}

.month-days-grid div.today.has-event::after {
    background-color: white;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: modal-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-pop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h3 {
    margin-top: 0;
    color: #2d3436;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

#modal-event-input {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 20px;
}

#modal-event-input:focus {
    border-color: #6c5ce7;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

#modal-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: #636e72;
}

#modal-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

#modal-save.primary {
    background: #6c5ce7;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

#modal-save.primary:hover {
    background: #5b4bc4;
    transform: translateY(-2px);
}