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

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #6e48aa, #9d50bb);
    color: #fff;
    padding: 10px;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-size: 1.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.input-section {
    margin-bottom: 15px;
}

input, select {
    padding: 8px;
    margin: 3px;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    outline: none;
    transition: background 0.3s;
    width: 100px;
}

input::placeholder, select:invalid {
    color: #ddd;
}

input:focus, select:focus {
    background: rgba(255, 255, 255, 0.3);
}

.dob-section {
    display: flex;
    justify-content: center;
    gap: 5px;
}

button {
    padding: 8px 16px;
    background: #ff6f61;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    transition: transform 0.1s, background 0.3s;
}

button:hover {
    background: #e65b50;
    transform: scale(1.05);
}

.result {
    margin-top: 10px;
    animation: fadeIn 1s ease-in-out;
}

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

.hidden {
    display: none;
}

h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

.stats p {
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px;
    border-radius: 5px;
}

.progress-section {
    margin-bottom: 10px;
}

.progress-section p {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.progress-bar {
    width: 100%;
    max-width: 300px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    margin: 0 auto;
    overflow: hidden;
}

#year-progress {
    height: 100%;
    background: #ff6f61;
    width: 0;
    transition: width 1s ease-in-out;
}

.grid {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 8px;
    max-width: 100%;
    max-height: 50vh;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 auto 10px;
}

.year-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 1px;
}

.year-label {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: #ddd;
}

.square {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.5s ease;
    animation: popIn 0.3s ease forwards;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.square.past {
    background-color: #ff4d4d;
}

.square.future {
    background-color: #4CAF50;
}

.square:hover {
    transform: scale(1.3);
}

.empty {
    width: 6px;
    height: 6px;
}

p#motivation-text {
    font-size: 0.9em;
    margin-top: 10px;
    font-style: italic;
}

.quote-section {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    animation: slideIn 1s ease-in-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

#motivational-quote {
    font-size: 0.9em;
    font-style: italic;
    color: #e0e0e0;
    margin-bottom: 5px;
}

#refresh-quote {
    padding: 5px 10px;
    font-size: 0.8em;
}

.notification-section {
    margin-top: 10px;
}

#toggle-notifications {
    padding: 5px 10px;
    font-size: 0.8em;
}

/* Media Queries for Responsiveness */
@media (max-width: 1200px) {
    .grid {
        grid-template-columns: repeat(16, 1fr);
        max-height: 45vh;
    }

    .square, .empty {
        width: 5px;
        height: 5px;
    }

    .year-label {
        font-size: 0.6em;
        top: -12px;
    }

    h1 {
        font-size: 1.3em;
    }

    h2 {
        font-size: 1em;
    }

    input, select {
        padding: 6px;
        font-size: 0.8em;
        width: 80px;
    }

    button {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .stats p {
        font-size: 0.8em;
        padding: 4px;
    }

    p#motivation-text {
        font-size: 0.8em;
    }

    #motivational-quote {
        font-size: 0.8em;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(10, 1fr);
        max-height: 40vh;
    }

    .square, .empty {
        width: 4px;
        height: 4px;
    }

    .year-label {
        font-size: 0.5em;
        top: -10px;
    }

    h1 {
        font-size: 1.1em;
    }

    h2 {
        font-size: 0.9em;
    }

    input, select {
        padding: 5px;
        font-size: 0.7em;
        width: 60px;
    }

    button {
        padding: 5px 10px;
        font-size: 0.7em;
    }

    .stats p {
        font-size: 0.7em;
        padding: 3px;
    }

    p#motivation-text {
        font-size: 0.7em;
    }

    #motivational-quote {
        font-size: 0.7em;
    }

    .dob-section {
        flex-wrap: wrap;
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: repeat(8, 1fr);
        max-height: 35vh;
    }

    .square, .empty {
        width: 3px;
        height: 3px;
    }

    .year-label {
        font-size: 0.4em;
        top: -8px;
    }

    h1 {
        font-size: 1em;
    }

    h2 {
        font-size: 0.8em;
    }

    input, select {
        padding: 4px;
        font-size: 0.6em;
        width: 50px;
    }

    button {
        padding: 4px 8px;
        font-size: 0.6em;
    }

    .stats p {
        font-size: 0.6em;
        padding: 2px;
    }

    p#motivation-text {
        font-size: 0.6em;
    }

    #motivational-quote {
        font-size: 0.6em;
    }
}