:root {
    --primary: #78846a;
    --secondary: #a4ae9e;
    --accent: #9ba79e;
    --light: #d0d7c7;
    --bg: #f3eeea;
    --text: #3d4437;
    --white: #ffffff;
    --shadow: rgba(120, 132, 106, 0.15);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg);
    z-index: -1;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

header {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.countdown-container {
    margin: 1rem 0;
    padding: 1.2rem;
    background: rgba(120, 132, 106, 0.05);
    border: 1px solid rgba(120, 132, 106, 0.1);
    border-radius: 50px;
    display: inline-block;
}

.wedding-date {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-block span {
    font-size: 2rem;
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    line-height: 1;
}

.time-block small {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
}

.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 20px 40px var(--shadow);
    transition: transform 0.3s ease;
}

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

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.card-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
}

.savings-highlight {
    background: var(--primary);
    color: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 2rem;
}

.savings-highlight span {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.savings-highlight h3 {
    font-size: 2.5rem;
    margin-top: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cost-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--light);
    position: relative;
    transition: all 0.3s ease;
}

.cost-item:hover {
    box-shadow: 0 5px 15px var(--shadow);
}

.cost-item span, .cost-item strong {
    display: block;
    outline: none;
    padding: 2px 5px;
    border-radius: 4px;
}

.cost-item span:focus, .cost-item strong:focus {
    background: var(--bg);
}

.cost-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.cost-item:hover .remove-btn {
    opacity: 1;
}

.secondary-btn {
    width: 100%;
    padding: 1rem;
    background: none;
    border: 2px dashed var(--secondary);
    color: var(--primary);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: var(--light);
    border-color: var(--primary);
}

.export-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px var(--shadow);
}

.export-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow);
    background: #6a745d;
}

.export-btn.secondary-btn-alt {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--light);
}

.export-btn.secondary-btn-alt:hover {
    background: var(--light);
    border-color: var(--primary);
}

.footer-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.total-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--light);
}

.total-card {
    text-align: right;
}

.total-card span {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
}

.total-card h3 {
    font-size: 2rem;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
}

.note {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--accent);
    font-style: italic;
}

/* Checklist */
.checklist {
    list-style: none;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light);
    position: relative;
}

.checklist li label {
    flex: 1;
    outline: none;
    padding: 2px 5px;
    border-radius: 4px;
}

.checklist li label:focus {
    background: var(--bg);
}

.checklist li .remove-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.checklist li:hover .remove-btn {
    opacity: 1;
}

.checklist li:last-child {
    border-bottom: none;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

label {
    cursor: pointer;
    font-weight: 400;
}

/* Tabs */
.lar-meta {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.rooms-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--light);
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.8rem 1.2rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--accent);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.tab-btn span {
    outline: none;
}

.tab-btn.active .remove-room-btn {
    opacity: 1;
    margin-left: 0.5rem;
    padding: 2px 6px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 4px;
}

.tab-btn .remove-room-btn {
    font-size: 0.7rem;
    color: #ff6b6b;
    opacity: 0;
    transition: all 0.3s;
    border: none;
    background: none;
    cursor: pointer;
}

.tab-btn:hover {
    background: var(--light);
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--light);
}

.room-content {
    animation: fadeIn 0.5s ease;
}

.items-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.items-list li {
    background: rgba(255, 255, 255, 0.5);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.items-list li:hover {
    background: rgba(255, 255, 255, 0.8);
}

.items-list li span {
    flex: 1;
    outline: none;
    padding: 2px 5px;
    border-radius: 4px;
}

.items-list li span:focus {
    background: var(--bg);
}

.items-list li .remove-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.items-list li:hover .remove-btn {
    opacity: 1;
}

.items-list li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    margin-right: 0.8rem;
}

.sub-room {
    margin-bottom: 2rem;
}

.sub-room h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 1px solid var(--light);
    padding-bottom: 0.3rem;
}

footer {
    text-align: center;
    padding: 4rem 0;
    color: var(--accent);
}

footer .date {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.beating-heart {
    color: #ff6b6b;
    fill: #ff6b6b;
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.hidden {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 1.5s ease;
}

.slide-up {
    animation: slideUp 1s ease forwards;
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .secondary-btn, 
    .export-btn, 
    .remove-btn, 
    .remove-room-btn, 
    #add-room-btn,
    #add-room-item-btn,
    #add-cost-btn,
    #add-doc-btn,
    .note {
        display: none !important;
    }

    body {
        background-color: var(--bg) !important;
        -webkit-print-color-adjust: exact;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .card {
        box-shadow: 0 10px 20px var(--shadow) !important;
        border: 1px solid rgba(120, 132, 106, 0.1) !important;
        background: rgba(255, 255, 255, 0.8) !important;
        break-inside: avoid;
        margin-bottom: 2rem;
    }

    .savings-highlight {
        background: var(--primary) !important;
        color: white !important;
    }

    .countdown-container {
        background: rgba(120, 132, 106, 0.05) !important;
        border: 1px solid rgba(120, 132, 106, 0.1) !important;
    }

    /* Force show all room items in print */
    .room-content {
        display: block !important;
    }

    .rooms-tabs {
        display: none !important;
    }

    .items-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .items-list li {
        background: rgba(255, 255, 255, 0.5) !important;
        padding: 0.5rem 1rem !important;
        border: 1px solid #eee !important;
    }
}
