/*
    RifaSon - Marketplace CSS
    Tema Claro sem Degradês (Light Theme, No Gradients)
*/

/* Dropdown de Usuário */
.user-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 15px;
}

.user-dropdown-btn {
    background: none;
    border: none;
    color: var(--color-text-main);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.user-dropdown-btn:hover {
    background-color: var(--color-secondary);
}

.user-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background-color: var(--color-surface);
    min-width: 180px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    z-index: 1000;
    border: 1px solid var(--color-border);
}

.user-dropdown-content.show {
    display: block;
}

.user-dropdown-content a {
    color: var(--color-text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.user-dropdown-content a i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.user-dropdown-content a:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
}

.user-dropdown-content hr {
    margin: 5px 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

/* Redimensionamento mobile */
@media (max-width: 768px) {
    .nav-right {
        gap: 10px;
    }

    .user-dropdown {
        margin-right: 0;
    }
}

:root {
    /* Colors */
    --color-bg: #f5f9ff;
    --color-surface: #ffffff;
    --color-primary: #0084ff;    /* Vibrant blue matching the logo */
    --color-primary-hover: #006ce6;
    --color-secondary: #e6f3ff;  /* Light blue for secondary */
    --color-secondary-hover: #cce6ff;
    --color-text-main: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #dbeafe;     /* Soft blue border */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;

    /* Typography */
    --font-family: 'Inter', sans-serif;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;

    /* Shadows - Flat / Subtle */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    color: var(--color-text-main);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    border-left: 4px solid var(--color-primary);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

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

.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-danger); }

.toast i { font-size: 1.25rem; }
.toast-success i { color: var(--color-success); }
.toast-error i { color: var(--color-danger); }

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

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-hover);
}

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

/* ==================
   HEADER & NAVBAR
================== */
.header {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 8.5rem;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-bar {
    flex: 1;
    max-width: 400px;
    display: flex;
    margin: 0 2rem;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    outline: none;
    font-family: var(--font-family);
    background-color: var(--color-bg);
    transition: all 0.2s;
}

.search-bar input:focus {
    border-color: var(--color-primary);
    background-color: var(--color-surface);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-bar button {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    /* Aumentado para mais espaço entre os botões */
}

.nav-link {
    color: var(--color-text-muted);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--color-text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: var(--font-family);
    text-align: center;
}

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

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

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

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

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    gap: 4px;
}

.rifa-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 768px) {
    .rifa-actions {
        width: 100%;
    }
    .rifa-actions .btn {
        flex: 1;
        min-width: fit-content;
    }
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text-main);
}

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

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #20ba5a;
    color: white;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-main);
    cursor: pointer;
}

.mobile-nav {
    display: none;
    background-color: var(--color-surface);
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav.active {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-btn {
    width: 100%;
}

/* ==================
   HERO SECTION
================== */
.hero {
    background-color: var(--color-surface);
    padding: 4rem 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-text-main);
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ==================
   MAIN CONTENT / GRID
================== */
.main-content {
    padding: 2rem 1.5rem 4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-surface);
    font-family: var(--font-family);
    color: var(--color-text-main);
    outline: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Raffle Cards */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

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

.card-image {
    width: 100%;
    height: 180px;
    position: relative;
    background-color: var(--color-secondary);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.badge-success {
    background-color: var(--color-success);
}

.card-content {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.card-creator {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.card-creator a {
    color: var(--color-primary);
    font-weight: 500;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--color-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.price {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.price-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.load-more {
    text-align: center;
    margin-top: 3rem;
}

/* ==================
   FOOTER
================== */
.footer {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 3rem 0 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--color-text-muted);
    font-size: 1.5rem;
}

.social-links a:hover {
    color: var(--color-primary);
}

.footer-links h4 {
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-payment h4 {
    margin-bottom: 1rem;
}

.payment-icons {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.payment-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    background-color: var(--color-bg);
}

/* ==================
   RESPONSIVE
================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .search-bar {
        display: none;
    }

    .search-bar-mobile {
        display: flex;
        margin: 0;
        max-width: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .mobile-hide {
        display: none !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    .mobile-full {
        width: 100% !important;
    }
}

/* ==================
   AUTH PAGES (Login / Register)
================== */
.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.auth-card {
    background-color: var(--color-surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 450px;
}

.auth-card-large {
    max-width: 600px;
}

.auth-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.flex-1 {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem; /* Diminuído gap entre label e input para mostrar proximidade */
    margin-bottom: 1.5rem; /* Aumentado espaçamento entre blocos diferentes de formulário */
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    text-align: left; /* Alinhamento estrito à esquerda */
    padding-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    transition: all 0.2s;
    background-color: var(--color-bg);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-surface);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.forgot-password {
    font-weight: 500;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-border);
    z-index: 1;
}

.auth-divider span {
    position: relative;
    z-index: 2;
    background-color: var(--color-surface);
    padding: 0 1rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.auth-footer-text {
    text-align: center;
    margin-top: 2rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.auth-footer-text a {
    font-weight: 600;
}

/* ==================
   PAGES GENERAL
================== */
.page-container {
    padding: 2rem 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
}

.text-muted {
    color: var(--color-text-muted);
}

.form-card {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.form-section {
    margin-bottom: 2.5rem;
}

.form-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-main);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.form-info-box {
    background-color: var(--color-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    text-align: right;
    font-size: 1.1rem;
}

.file-upload {
    position: relative;
}

.file-input {
    display: none;
}

.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--color-surface);
}

.upload-area:hover {
    border-color: var(--color-primary);
    background-color: var(--color-secondary);
}

.upload-area i {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.upload-area p {
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

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

.text-center {
    text-align: center;
}

.text-success {
    color: var(--color-success) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.footer-simple {
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    margin-top: 4rem;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
}

/* ==================
   PROMO BANNER
================== */
.promo-banner {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    text-align: center;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.2);
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.promo-banner i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.promo-badge {
    background: white;
    color: #ea580c;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.promo-banner strong {
    font-weight: 800;
}

.promo-link {
    color: #fff !important;
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 18px;
    border-radius: var(--radius-md);
    margin-left: 10px;
    transition: all 0.3s ease;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.promo-link:hover {
    background: white;
    color: #ea580c !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.promo-link i {
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .promo-banner {
        flex-direction: column;
        padding: 18px 15px;
        gap: 12px;
    }
    
    .promo-link {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}