:root {
    --red-bg: #B11226; 
    --gold: #D4AF37;
    --paper: #FAF9F6;
    --text-dark: #333;
    --burgundy: #800020; 
    --dark-bg: #2c000b; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Georgia, 'Times New Roman', Times, serif;
}

html, body {
    height: 100%; 
    width: 100%;
    margin: 0;
    overflow: hidden; 
}

body {
    background-color: var(--red-bg);
    background-image: linear-gradient(135deg, var(--red-bg), var(--red-bg));
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    transition: background-image 1.2s ease, background-color 1.2s ease, color 1s ease;
}

.snow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.5s ease;
}

.snow-back {
    background-image:
        radial-gradient(1px 1px at 20% 30%, white 100%, transparent),
        radial-gradient(1px 1px at 70% 80%, white 100%, transparent),
        radial-gradient(1px 1px at 40% 60%, white 100%, transparent);
    background-size: 200px 200px;
    animation: snow-fall 30s linear infinite;
    opacity: 0.5;
}

.snow-mid {
    background-image:
        radial-gradient(1.8px 1.8px at 30% 20%, white 100%, transparent),
        radial-gradient(1.5px 1.5px at 80% 40%, white 100%, transparent);
    background-size: 150px 150px;
    animation: snow-fall 18s linear infinite;
    opacity: 0.4;
}

@keyframes snow-fall {
    from { background-position: 0 0; }
    to { background-position: 0 800px; }
}

.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1rem 2rem 0rem;
    z-index: 10;
}

.nav-title {
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    font-family: "Henny Penny", system-ui;
    font-size: 4rem;
    color: rgb(251, 252, 251);
    letter-spacing: 1px;
}

.main-container {
    flex: 1; 
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    padding-top: 0.5rem;
    overflow: hidden;
    min-height: 0; 
    z-index: 2;
}

.todo-frame {
    background-color: var(--paper);
    width: 100%;
    max-width: 700px;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    padding-bottom: 0.5rem;
    z-index: 3;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
    border-radius: 12px;
    border: 3px solid var(--gold);
    outline: 2px solid var(--red-bg); 
    outline-offset: -7px; 
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 0 15px rgba(212, 175, 55, 0.4), 0 10px 30px rgba(0,0,0,0.3);
    transition: outline-color 0.5s ease;
}

.todo-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.todo-header h2 {
    font-size: 1.5rem;
    color: #05664a;
}

.countdown-container {
    display: flex;
    justify-content: center;
    gap: 20px; 
    z-index: 10; 
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--paper); 
    color: var(--red-bg); 
    padding: 8px 12px;
    border-radius: 12px;
    min-width: 85px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); 
    border: 2px solid var(--gold); 
}

.time-box span:first-child {
    font-size: 1.4rem; 
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1;
}

.time-box .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #555;
    margin-top: 4px;
    font-weight: bold;
    font-family: sans-serif;
}

.todo-form {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.todo-form input[type="text"],
.todo-form textarea,
.todo-form button {
    grid-column: 1 / -1;
}

.todo-form input[type="url"] {
    grid-column: span 1; 
    width: 100%;
}


.custom-select {
    position: relative;
    cursor: pointer;
    grid-column: span 1; 
    width: 100%;
    font-family: Georgia, 'Times New Roman', Times, serif; 
}

.todo-form input,
.todo-form textarea {
    width: 100%;
    background-color: #fffdfa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: var(--text-dark);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: Georgia, 'Times New Roman', Times, serif !important;
}

.todo-form input {
    height: 40px;
    padding: 0 0.8rem;
}

.todo-form textarea {
    min-height: 50px;
    height: 60px;
    padding: 0.6rem 0.8rem;
    resize: vertical;
}

.todo-form input:focus,
.todo-form textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    transform: translateY(-1px);
}

.todo-form button {
    background-color: var(--red-bg);
    color: white;
    border: none;
    padding: 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 5px rgba(177, 18, 38, 0.2);
}

.todo-form button:hover {
    background-color: #8f0e1f;
    transform: translateY(-1px);
}

.hidden { 
    display: none; 
}

.custom-select {
    position: relative;
    cursor: pointer;
    user-select: none;
    border: none; 
    background-color: transparent;
    padding: 0; 
    width: 100%;
}

.select-headboard {
    background-color: #fffdfa; 
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0 0.8rem;
    height: 40px; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-dark);
    transition: all 0.2s ease;
    font-size: 0.95rem; 
}

.select-headboard::after {
    content: "▼";
    color: var(--gold);
    font-size: 0.8rem;
}

.select-headboard:hover,
.custom-select.active .select-headboard {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.select-options {
    position: absolute;
    top: 105%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 0;
    z-index: 1000; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    display: block;
    overflow: hidden; 
}

.select-options.view { 
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.option {
    padding: 10px 1rem;
    border-bottom: 1px solid #eee;
    color: var(--text-dark);
}

.option:hover {
    background-color: var(--red-bg);
    color: white;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    flex: 1; 
    overflow-y: auto; 
    min-height: 0;
    padding-right: 8px;
    padding-bottom: 20px;
}

.todo-list::-webkit-scrollbar { 
    width: 8px; 
}

.todo-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb {
    background-color: var(--red-bg);
    border-radius: 10px;
    border: 2px solid var(--paper);
}

.todo-list::-webkit-scrollbar-thumb:hover { 
    background-color: #8f0e1f; 
}

.todo-card {
    background-color: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-left: 6px solid var(--gold);
    transition: transform 0.2s ease, background-color 0.3s ease;
}

.todo-card:hover { 
    transform: translateY(-3px); 
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    color: var(--red-bg);
}

.card-description {
    margin: 0.5rem 0 0.8rem;
    font-size: 0.95rem;
}

.card-link {
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--red-bg);
    font-weight: bold;
}
.card-link:hover { 
    text-decoration: underline; 
}

.card-footer {
    margin-top: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-priority {
    font-size: 0.85rem;
    color: #555;
}

.card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.edit-btn, .delete-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem; 
    cursor: pointer;
    color: #ccc; 
    transition: all 0.2s ease; 
    padding: 0;
}
.edit-btn:hover { 
    color: var(--gold); 
    transform: scale(1.1); 
}

.delete-btn:hover { 
    color: var(--red-bg); 
    transform: scale(1.1); 
}

.footer {
    text-align: center;
    padding: 1rem;
    color: white;
    font-size: 0.9rem;
    z-index: 10;
}

.fa-github {
    font-size: 25px;
    color: #ccc;
    margin-bottom: 10px;
}

.santa-stats {
    display: none; 
    justify-content: space-between;
    background-color: #2c3e50;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid var(--gold);
    animation: slideDown 0.5s ease; 
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
    margin-bottom: 20px;
    margin-left: 0; 
    margin-right: auto; 
    padding: 10px 15px;
    gap: 10px; 
    border-radius: 20px;
    width: fit-content; 
    z-index: 10;
}

.switch-label {
    font-size: 1.1rem;
    font-family: "Henny Penny", system-ui;
    font-weight: bold;
    color: #ccc; 
    transition: color 0.3s ease;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #9ca3af; 
    transition: .4s;
    border-radius: 34px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider { 
    background-color: var(--red-bg); 
}

input:checked + .slider:before { 
    transform: translateX(26px); 
}

.switch-wrapper:has(input:checked) .adult-label {
    color: var(--gold); 
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.switch-wrapper:has(input:not(:checked)) .kid-label {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.check-btn { 
    display: none; 
}

.status-label { 
    display: none; 
}

.todo-card.completed {
    background-color: white !important;
    border-left-color: var(--gold) !important;
    opacity: 1 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

.todo-card.completed .card-title {
    text-decoration: none !important;
    color: var(--red-bg) !important;
}

body.santa-mode {
    background-color: var(--burgundy);
    background-image: linear-gradient(135deg, #800020, #2c000b);
    color: #0f0f0f;
}

body.santa-mode .custom-select,
body.santa-mode #giftPriority {
    display: none !important;
}

body.santa-mode .snow { 
    opacity: 0.3; 
}

body.santa-mode h1, 
body.santa-mode h2 {
    color: var(--gold); 
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

body.santa-mode .todo-form button {
    width: 100%;
    margin-top: 5px;
}

body.santa-mode .santa-stats {
    display: flex; 
    background-color: rgba(40, 0, 10, 0.6); 
    border: 2px solid var(--gold); 
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3); 
    color: #fff;
}

body.santa-mode .santa-stats span {
    color: var(--gold);
    font-weight: bold;
}

body.santa-mode .check-btn {
    display: flex; 
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: transparent;
    border: none; 
    border-radius: 0;
    font-size: 1.3rem; 
    color: #059669;   
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 2px;
    padding: 0;
}

body.santa-mode .check-btn:hover {
    transform: scale(1.15);
    color: #05664a;
    background-color: transparent; 
}

body.santa-mode .todo-card.completed .check-btn {
    color: #0c815c !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

body.santa-mode .todo-card.completed {
    background-color: #d1fae5 !important; 
    border-left-color: #059669 !important;
    opacity: 0.95 !important;
}

body.santa-mode .todo-card.completed .card-title {
    text-decoration: line-through !important;
    color: #6b7280 !important;
}

body.santa-mode .todo-card.completed .status-label {
    display: block !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    color: #059669;
    font-weight: bold;
    margin-right: 10px;
}

body.santa-mode .todo-form input[type="url"] {
    display: none !important;
}

body.santa-mode .custom-select {
    display: none !important;
}

body.santa-mode .todo-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.santa-mode .countdown-container {
    display: none !important;
}

body.santa-mode .navbar {
    padding-top: 0.5rem !important;
    padding-bottom: 0 !important;
    min-height: auto; 
}

body.santa-mode .todo-header {
    display: none !important;
}

.todo-frame {
    position: relative;
    overflow: visible; 
}

.corner-ornament {
    position: absolute;
    width: 95px;  
    height: 95px;
    
    pointer-events: none;
    z-index: 10;
    opacity: 1; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23D4AF37' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M2 2 L45 45' /%3E%3Cpath d='M2 2 L90 2' /%3E%3Cpath d='M2 2 L2 90' /%3E%3Cpath d='M20 20 L20 2' /%3E%3Cpath d='M20 20 L2 20' /%3E%3Cpath d='M45 45 L45 25' /%3E%3Cpath d='M45 45 L25 45' /%3E%3Cpath d='M70 2 L60 12' /%3E%3Cpath d='M70 2 L80 12' /%3E%3Cpath d='M2 70 L12 60' /%3E%3Cpath d='M2 70 L12 80' /%3E%3Ccircle cx='2' cy='2' r='4' fill='%23D4AF37'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    
    border: none !important;
    box-shadow: none !important;
}

.top-left {
    top: -22px; left: -22px;
    background-position: top left;
}

.top-right {
    top: -22px; right: -22px;
    background-position: top right;
    transform: scaleX(-1); 
}

.bottom-left {
    bottom: -22px; left: -22px;
    background-position: bottom left;
    transform: scaleY(-1); 
}

.bottom-right {
    bottom: -22px; right: -22px;
    background-position: bottom right;
    transform: scale(-1); 
}

body.santa-mode .corner-ornament {
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7));
}

.corner-ornament {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23D4AF37' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M2 2 L45 45' /%3E%3Cpath d='M2 2 L90 2' /%3E%3Cpath d='M2 2 L2 90' /%3E%3Cpath d='M20 20 L20 2' /%3E%3Cpath d='M20 20 L2 20' /%3E%3Cpath d='M45 45 L45 25' /%3E%3Cpath d='M45 45 L25 45' /%3E%3Cpath d='M70 2 L60 12' /%3E%3Cpath d='M70 2 L80 12' /%3E%3Cpath d='M2 70 L12 60' /%3E%3Cpath d='M2 70 L12 80' /%3E%3Ccircle cx='2' cy='2' r='4' fill='%23D4AF37'/%3E%3C/svg%3E");
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(5px); 
    display: flex; 
    justify-content: center;
    align-items: center;
    z-index: 9999; 
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background-color: var(--paper);
    width: 90%;
    max-width: 450px;
    padding: 20px;
    border-radius: 12px;
    border: 3px solid var(--gold);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    text-align: center;
    position: relative;
}

.modal-overlay.show .modal-card {
    transform: translateY(0);
}

.modal-header h3 {
    color: var(--red-bg);
    font-family: "Henny Penny", system-ui;
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 var(--gold);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
}

.close-modal:hover { 
    color: var(--red-bg); 
}

.modal-body p {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 10px;
}

.modal-divider {
    border: 0;
    height: 1px;
    background: var(--gold);
    margin: 15px 0;
    opacity: 0.5;
}

.modal-btn {
    background-color: var(--red-bg);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    border: 2px solid transparent;
}

.modal-btn:hover {
    background-color: white;
    color: var(--red-bg);
    border-color: var(--red-bg);
}

.help-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--red-bg);
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 50%;
    font-family: "Henny Penny", system-ui; 
    font-size: 1.8rem;
    line-height: 1; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1000; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    display: flex;
    justify-content: center;
    align-items: center;
}

.help-btn:hover {
    transform: scale(1.15) rotate(10deg); 
    background-color: var(--gold);
    color: var(--red-bg);
    border-color: var(--red-bg);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6); 
}

.help-btn:active {
    transform: scale(0.9);
}

body.santa-mode .help-btn {
    background-color: var(--gold);
    color: var(--burgundy);
    border-color: var(--burgundy);
}


@media (max-width: 768px) {
    body {
        overflow-x: hidden; 
        padding: 10px; 
    }

    .navbar {
        display: flex;
        flex-direction: column-reverse; 
        gap: 10px;
        padding-bottom: 1rem;
    }

    .nav-title {
        font-size: 2.5rem; 
        line-height: 1.2;
    }
    
    .switch-wrapper {
        transform: scale(0.9); 
    }

    .todo-frame {
        width: 95%; 
        padding: 1rem; 
        margin-top: 10px;
    }

    .todo-form {
        grid-template-columns: 1fr 1fr !important; 
        gap: 8px;
    }

    .input-name,
    #giftDescription,
    .todo-form button {
        grid-column: 1 / -1;
    }

    .custom-select, 
    .todo-form input[type="url"] {
        grid-column: span 1 !important; 
        width: 100% !important;  
        min-width: 0;   
    }

    .select-headboard {
        padding: 0 0.5rem; 
        font-size: 0.9rem;
    }

    .corner-ornament { 
        width: 60px; 
        height: 60px; 
    }

    .top-left { 
        top: -12px; 
        left: -12px; 
    }

    .top-right { 
        top: -12px; 
        right: -12px; 
    }

    .bottom-left { 
        bottom: -12px; 
        left: -12px; 
    }

    .bottom-right { 
        bottom: -12px; 
        right: -12px; 
    }

    .countdown-container { 
        gap: 10px; 
    }

    .time-box { 
        min-width: 60px; 
        padding: 8px; 
    }

    .time-box span:first-child { 
        font-size: 1.5rem; 
    }

    .santa-stats { 
        gap: 5px; 
        flex-wrap: wrap; 
    }

    .santa-stats div, 
    .santa-stats span {
        font-size: 0.9rem !important; 
        white-space: nowrap; 
    }

    .stat-box { 
        flex: 1; 
        min-width: 80px; 
    }

    .todo-item { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 10px; 
    }

    .todo-actions { 
        width: 100%; 
        justify-content: flex-end; 
    }

    .status-label,
    body.santa-mode .todo-card.completed .status-label {
        display: none !important;
    }
    
    .help-btn { 
        width: 40px; 
        height: 40px; 
        bottom: 15px; 
        right: 15px; 
    }

    .modal-card { 
        width: 90%; 
        max-height: 80vh; 
        overflow-y: auto; 
    }
}