/* CSS Custom Properties */
:root {
    --primary-color: #7868E6;
    --secondary-color: #B8B5FF;
    --accent-color: #FFB4B4;
    --light-bg: #EDEEF7;
    --light-blue: #d1fdfd;
    --white: #ffffff;
    --dark-text: #2c2c2c;
    --light-text: #666666;
    --border-radius: 14px;
    --box-shadow: 0 6px 18px rgba(120, 104, 230, 0.14);
    --soft-shadow-hover: 0 10px 28px rgba(120, 104, 230, 0.20);
    --inner-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
    --transition: all 0.25s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --header-offset: 80px; /* altura aproximada do header */
    --safe-bottom: 96px;   /* espaço reservado p/ banner/ActionBar */
}

/* Generic icon style */
.icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn .icon,
.nav-btn__icon .icon {
    margin-right: 6px;
}

.list-item__info .icon {
    margin-right: 4px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-text);
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--light-blue) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

/* Paper Texture Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 104, 230, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(184, 181, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(209, 253, 253, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
   
}

/* Header Styles */
.header {
    background: var(--white);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header__title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.brand-logo {
    height: 45px;
    width: auto;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
    padding: 4px 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(120, 104, 230, 0.08), rgba(184, 181, 255, 0.08));
    box-shadow: 0 2px 8px rgba(120, 104, 230, 0.20), inset 0 1px 0 rgba(255,255,255,0.6);
    filter: saturate(1.05) contrast(1.05);
    transition: var(--transition);
}

.header__nav {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding-bottom: 1rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--light-text);
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--border-radius);
    min-width: 76px;
    white-space: nowrap;
    scroll-snap-align: start;
    flex: 0 0 auto;
}

.nav-btn:hover {
    background: var(--light-bg);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--box-shadow);
}

.nav-btn__icon {
    font-size: 1.25rem;
}

.nav-btn__text {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(78vh - 200px);
}

/* Body state when toast is visible (for spacing tweaks) */
body.toast-visible .main {
    padding-top: 2.5rem;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.section.active {
    display: block;
}

.section__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.section-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow), var(--inner-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--soft-shadow-hover);
}

.dashboard-card__icon {
    font-size: 2.5rem;
    background: var(--light-bg);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-card__content h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.dashboard-card__number {
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-text);
    margin-bottom: 0.25rem;
}

.dashboard-card__label {
    font-size: 0.9rem;
    color: var(--light-text);
}

.dashboard-progress {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    text-align: center;
    margin-bottom: 1rem;
}

.dashboard-progress h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.progress-bar {
    background: var(--light-bg);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-weight: 600;
    color: var(--primary-color);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn--primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--box-shadow);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(0,0,0,0.02));
}

.btn--primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--soft-shadow-hover);
}

.btn--secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid rgba(120, 104, 230, 0.35);
}

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

.btn--danger {
    background: var(--accent-color);
    color: var(--white);
}

.btn--danger:hover {
    background: #ff9999;
}

/* List Styles */
.guests-list,
.activities-list,
.gifts-list,
.expenses-list {
    display: grid;
    gap: 1rem;
}

.list-item {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow), var(--inner-shadow);
    transition: var(--transition);
}

.list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--soft-shadow-hover);
}

.list-item__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.list-item__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.list-item__subtitle {
    color: var(--light-text);
    font-size: 0.9rem;
}

.list-item__actions {
    display: flex;
    gap: 0.5rem;
}

.list-item__actions .btn {
    padding: 0.5rem;
    font-size: 0.9rem;
}

.list-item__content {
    display: grid;
    gap: 0.5rem;
}

.list-item__info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.list-item__status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status--confirmed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status--pending {
    background: #fff3e0;
    color: #f57c00;
}

.status--declined {
    background: #ffebee;
    color: #d32f2f;
}

.status--completed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status--received {
    background: #e3f2fd;
    color: #1976d2;
}

/* Budget Styles */
.budget-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.budget-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    text-align: center;
}

.budget-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.budget-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-text);
}

.budget-amount.spent {
    color: var(--accent-color);
}

.budget-amount.remaining {
    color: #2e7d32;
}

/* Empty State */
.empty-state {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    color: var(--light-text);
    box-shadow: var(--box-shadow);
}
.empty-state p:first-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* Priority badges */
.priority {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.priority--low {
    background: #e9f7ef;
    color: #2e7d32;
}
.priority--medium {
    background: #fff7e6;
    color: #f57c00;
}
.priority--high {
    background: #ffebee;
    color: #d32f2f;
}

/* Expense amount emphasis */
.expense-amount {
    font-weight: 700;
    color: var(--dark-text);
}

/* Over budget warning */
.over-budget {
    color: #d32f2f !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(var(--header-offset) + -70px);
    padding-bottom: var(--safe-bottom);
    animation: fadeIn 0.3s ease;
}

.modal__content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - var(--header-offset) - var(--safe-bottom) - 40px);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--light-text);
    z-index: 1001;
}

.modal__close:hover {
    color: var(--primary-color);
}

.modal__body {
    padding: 2rem;
}

/* Form Styles */
.form {
    display: grid;
    gap: 1.5rem;
}

.form__group {
    display: grid;
    gap: 0.5rem;
}

.form__label {
    font-weight: 500;
    color: var(--dark-text);
}

.form__input,
.form__textarea,
.form__select {
    padding: 0.75rem;
    border: 2px solid var(--light-bg);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(120, 104, 230, 0.1);
}

.form__textarea {
    resize: vertical;
    min-height: 100px;
}

.form__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form__checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.form__actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Toast Styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--box-shadow);
    z-index: 900;
    transform: translateX(100%);
    transition: var(--transition);
}

.toast.show {
    transform: translateX(0);
}

.toast__content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast__icon {
    font-size: 1.2rem;
}

.toast__message {
    font-weight: 500;
    color: var(--dark-text);
}

/* Footer Styles */
.footer {
    background: var(--white);
    padding: 2.5rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--light-bg);
}

.footer__links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: start;
    justify-items: start;
    margin-bottom: 1rem;
}

.footer__section {
    text-align: left;
}

.footer__section h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.25rem;
    display: inline-block;
}

.footer__links p {
    margin: 0.25rem 0;
}

.footer__links a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(0,0,0,0.15);
}

.footer__links a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.footer p {
    text-align: center;
    color: var(--light-text);
    font-size: 0.9rem;
}

.footer__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    height: 28px;
    width: auto;
    opacity: 0.95;
    display: inline-block;
    padding: 4px 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(120, 104, 230, 0.08), rgba(184, 181, 255, 0.08));
    box-shadow: 0 2px 8px rgba(120, 104, 230, 0.20), inset 0 1px 0 rgba(255,255,255,0.6);
    filter: saturate(1.05) contrast(1.05);
    transition: var(--transition);
}

/* Footer - Small screens adjustments */
@media (max-width: 600px) {
    .footer__links {
        justify-items: center;
        text-align: center;
        gap: 1rem;
    }
    .footer__section {
        text-align: center;
    }
    .footer__section h4 {
        display: inline-block;
        margin-left: auto;
        margin-right: auto;
    }
}

.brand-logo:hover,
.footer-logo:hover {
    transform: translateY(-1px) scale(1.03);
    filter: saturate(1.1) contrast(1.1);
    box-shadow: 0 6px 16px rgba(120, 104, 230, 0.25), inset 0 1px 0 rgba(255,255,255,0.7);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header__title {
        font-size: 1.5rem;
    }
    
    .header__nav {
        gap: 0.25rem;
        justify-content: flex-start;
        padding: 10px 5px 5px;
    }
    
    .nav-btn {
        min-width: 80px;
        padding: 0.5rem 0.75rem;
    }
    
    .nav-btn__icon {
        font-size: 1.25rem;
    }
    
    .nav-btn__text {
        font-size: 0.75rem;
    }
    
    .section__title {
        font-size: 1.5rem;
    }
    /* On tablets and small screens, add extra top padding while toast is visible */
    body.toast-visible .main {
        padding-top: 3.25rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-card {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-card__icon {
        margin-bottom: 1rem;
    }
    
    .section-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .list-item__header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .list-item__actions {
        width: 100%;
        justify-content: center;
    }
    
    .budget-summary {
        grid-template-columns: 1fr;
    }
    
    .modal__content {
        width: 95%;
        margin: 20px;
    }
    
    .form__actions {
        flex-direction: column;
    }
    
    .toast {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(100%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    /* Em telas bem pequenas, manter tudo em uma linha com rolagem horizontal */
    .header__nav {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.4rem;
        overflow-x: auto;
        padding: 10px 5px 5px;
        scroll-snap-type: x proximity;
    }
    .nav-btn {
        min-width: 78px;
        padding: 0.5rem 0.6rem;
        flex: 0 0 auto;
    }
    .nav-btn__icon {
        font-size: 1.15rem;
    }
    .main {
        padding: 1rem 0;
    }
    .brand-logo,
    .footer-logo {
        height: 35px;
        padding: 3px 5px;
        border-radius: 8px;
    }
    
    .dashboard-card__number {
        font-size: 1.5rem;
    }
    
    .budget-amount {
        font-size: 1.5rem;
    }
    
    .modal__body {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .header__nav,
    .section-controls,
    .list-item__actions,
    .modal,
    .toast {
        display: none !important;
    }
    
    .section {
        display: block !important;
    }
    
    body {
        background: white !important;
    }
    
    .list-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --secondary-color: #4040ff;
        --accent-color: #cc0000;
        --light-bg: #f0f0f0;
        --dark-text: #000000;
        --light-text: #333333;
    }
}

/* Focus Indicators */
.btn:focus,
.nav-btn:focus,
.form__input:focus,
.form__textarea:focus,
.form__select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
