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

:root {
    --primary-color: #7b2cbf;
    --primary-dark: #5a1a8f;
    --secondary-color: #f3e8ff;
    --accent-color: #e9d5ff;
    --text-dark: #212121;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --white: #ffffff;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e9d5ff 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 8px 16px;
    background: var(--secondary-color);
    border-radius: 25px;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.user-name.admin-badge {
    color: var(--primary-color);
}

.ganadores-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.ganadores-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.ganadores-btn i {
    font-size: 0.9rem;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.logout-btn:hover {
    background: rgba(123, 44, 191, 0.1);
}

.login-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.chat-toggle {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.chat-toggle .badge {
    background: var(--danger);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 0.8rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--white);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

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

/* Sorteos Grid */
.sorteos-section {
    padding: 0.5rem 0 2rem;
}

.sorteos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Sorteo Card */
.sorteo-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.sorteo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(123, 44, 191, 0.15);
    border-color: var(--primary-color);
}

.sorteo-image-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.sorteo-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sorteo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sorteo-card:hover .sorteo-image img {
    transform: scale(1.05);
}

.sorteo-image .sorteo-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    background: var(--secondary-color);
}

.sorteo-badge-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sorteo-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sorteo-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sorteo-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.8rem;
}

.meta-item i {
    color: var(--primary-color);
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.sorteo-stats-compact {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #f3e8ff 100%);
    border-radius: 8px;
    margin-top: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.stat-item i {
    color: var(--primary-color);
    font-size: 1rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-text {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: lowercase;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: #e0e0e0;
}

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

.badge-finalizado {
    background: #9e9e9e;
    color: var(--white);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Chat Modal */
.chat-modal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    z-index: 2000;
    overflow: hidden;
}

.chat-modal.active {
    display: flex;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.close-chat {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-light);
}

.welcome-message {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.welcome-message i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.admin {
    background: #7b2cbf;
    color: var(--white);
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.message.user {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--secondary-color);
    border-bottom-left-radius: 5px;
}

.message-header {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 4px;
}

.chat-input-container {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid var(--secondary-color);
}

.chat-name-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--secondary-color);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: var(--primary-color);
}

.send-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Info Section */
.info-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4rem 0;
    margin-top: 3rem;
}

.info-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.info-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.info-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    text-align: left;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(123, 44, 191, 0.15);
    border-color: var(--primary-color);
}

.info-card:hover::before {
    transform: scaleX(1);
}

.info-number {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-color);
    opacity: 0.3;
    line-height: 1;
}

.info-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(123, 44, 191, 0.3);
}

.info-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.info-card p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

.comprar-section-main {
    padding: 1.5rem 0;
}

.comprar-ticket-main-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.3);
}

.comprar-ticket-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 44, 191, 0.4);
}

.sorteo-option-item {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
}

.sorteo-option-item:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
    transform: translateX(5px);
}

.sorteo-option-item h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.sorteo-option-item p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Modal de Login */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin: 0;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.error-message {
    background: #ffebee;
    color: var(--danger);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid var(--danger);
}

.submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--secondary-color);
}

.form-footer p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 0.7rem 0;
    }

    .hero h1 {
        font-size: 1.2rem;
    }

    .hero p {
        font-size: 0.75rem;
    }

    .sorteos-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .sorteo-image-wrapper {
        height: 140px;
    }

    .sorteo-content {
        padding: 0.85rem;
    }

    .info-section {
        padding: 2.5rem 0;
    }

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

    .info-title {
        font-size: 1.8rem;
    }

    .info-subtitle {
        font-size: 0.95rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .info-card {
        padding: 2rem 1.5rem;
    }

    .info-number {
        font-size: 2.5rem;
    }

    .sorteos-grid {
        grid-template-columns: 1fr;
    }

    .chat-modal {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .user-name {
        display: none;
    }

    .login-btn span {
        display: none;
    }

    .ganadores-btn span {
        display: none;
    }

    .chat-toggle {
        padding: 8px 12px;
        font-size: 0.85rem;
        gap: 4px;
    }

    .chat-toggle span {
        display: none;
    }

    .chat-toggle i {
        font-size: 1rem;
    }

    .chat-toggle .badge {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
        top: -3px;
        right: -3px;
    }

    .logo-img {
        height: 60px;
    }

    .logo span {
        font-size: 1.2rem;
    }
}


