/**
 * ASSEGO App Styles
 * assets/css/app.css
 */

/* Base styles */
:root {
    --assego-primary: #000e72;
    --assego-primary-dark: #000a58;
    --assego-primary-light: #1a27a3;
    --assego-accent: #ffdf00;
    --assego-accent-dark: #ffc700;
    --assego-bg: #f8f9fc;
    --assego-gray: #7a7a7a;
    
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    --shadow-sm: 0 4px 6px rgba(0, 14, 114, 0.05);
    --shadow-md: 0 6px 16px rgba(0, 14, 114, 0.1);
    --shadow-lg: 0 12px 28px rgba(0, 14, 114, 0.15);
}

/* Background gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 223, 0, 0.04) 0%, transparent 200px),
        radial-gradient(circle at 80% 80%, rgba(0, 14, 114, 0.04) 0%, transparent 200px);
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--assego-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--assego-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--assego-primary-light);
}

/* News ticker */
.news-ticker {
    position: relative;
    z-index: 10;
}

.news-ticker::before,
.news-ticker::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50px;
    height: 100%;
    z-index: 2;
}

.news-ticker::before {
    left: 0;
    background: linear-gradient(90deg, var(--assego-accent), transparent);
}

.news-ticker::after {
    right: 0;
    background: linear-gradient(90deg, transparent, var(--assego-accent));
}

.news-ticker-content {
    animation: ticker 60s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.news-ticker-item {
    display: inline-flex;
    align-items: center;
    padding-right: 3rem;
}

/* Grid items */
.grid-item {
    position: relative;
    transition: transform var(--transition-medium), 
                box-shadow var(--transition-medium);
    z-index: 1;
    background: white !important; /* Força fundo branco */
}

.grid-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--assego-accent-dark), var(--assego-accent)) border-box;
    -webkit-mask: 
        linear-gradient(#fff 0 0) padding-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.85;
    z-index: -1;
}

.grid-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,223,0,0.05), rgba(0,14,114,0.03));
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-medium);
    border-radius: 1rem;
}

.grid-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.grid-item:hover::after {
    opacity: 1;
}

/* Força cores corretas para ícones e textos dos cards */
.grid-item i,
.grid-item p {
    color: var(--assego-primary) !important;
}

/* Icon gradient */
.icon-gradient {
    background: linear-gradient(135deg, var(--assego-primary), var(--assego-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 3px rgba(0, 14, 114, 0.2));
}

/* Social buttons */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.social-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Modal styles */
.modal-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Loading screen */
#loading-screen {
    background: white;
    transition: opacity 0.5s ease-out;
}

/* Banner */
.banner-slide {
    transition: opacity 0.5s ease-in-out;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out backwards;
}

/* Grid animations with stagger */
.grid-item:nth-child(1) { animation: fadeInUp 0.5s ease-out 0.1s backwards; }
.grid-item:nth-child(2) { animation: fadeInUp 0.5s ease-out 0.15s backwards; }
.grid-item:nth-child(3) { animation: fadeInUp 0.5s ease-out 0.2s backwards; }
.grid-item:nth-child(4) { animation: fadeInUp 0.5s ease-out 0.25s backwards; }
.grid-item:nth-child(5) { animation: fadeInUp 0.5s ease-out 0.3s backwards; }
.grid-item:nth-child(6) { animation: fadeInUp 0.5s ease-out 0.35s backwards; }
.grid-item:nth-child(7) { animation: fadeInUp 0.5s ease-out 0.4s backwards; }
.grid-item:nth-child(8) { animation: fadeInUp 0.5s ease-out 0.45s backwards; }
.grid-item:nth-child(9) { animation: fadeInUp 0.5s ease-out 0.5s backwards; }

/* ========================================
   CARTEIRINHA DIGITAL STYLES
   ======================================== */

/* Carteirinha background */
.carteirinha-page {
    background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
    min-height: 100vh;
    position: relative;
}

/* Carteirinha card moderna */
.carteirinha-card {
    background: white;
    border-radius: 24px;
    box-shadow: 
        0 10px 40px rgba(0, 14, 114, 0.1),
        0 2px 10px rgba(0, 14, 114, 0.05);
    position: relative;
    overflow: hidden;
}

.carteirinha-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(135deg, var(--assego-primary) 0%, var(--assego-primary-light) 100%);
    z-index: 0;
}

/* Pattern overlay no header da carteirinha */
.header-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    opacity: 0.1;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,.05) 10px, rgba(255,255,255,.05) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.05) 10px, rgba(255,255,255,.05) 20px);
    z-index: 1;
}

/* Timer circular moderno */
.timer-circle {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.timer-circle:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.25);
}

.timer-progress {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--assego-accent) 0deg,
        var(--assego-accent) var(--progress),
        transparent var(--progress)
    );
    transition: all 1s linear;
    z-index: -1;
}

/* Foto com borda elegante */
.foto-frame {
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    overflow: hidden;
    background: white;
}

/* QR Code estilizado */
.qr-container {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.qr-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, var(--assego-accent), var(--assego-accent-dark));
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
}

/* Info badges */
.info-badge {
    background: var(--assego-bg);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.info-badge:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.info-badge i {
    width: 24px;
    text-align: center;
    color: var(--assego-primary);
}

/* Status indicator */
.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Skeleton loader melhorado */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Slide in animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out backwards;
}

/* Header fixo elegante para carteirinha */
.carteirinha-header {
    background: white;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Placeholder de foto elegante */
.foto-placeholder {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.foto-placeholder i {
    color: #9ca3af;
}

/* ========================================
   FIM DOS ESTILOS DA CARTEIRINHA
   ======================================== */

/* Utility classes */
.no-scroll {
    overflow: hidden;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .grid-item {
        aspect-ratio: 1/1;
    }
    
    .social-btn {
        width: 40px;
        height: 40px;
    }
    
    .social-btn i {
        font-size: 1rem;
    }
    
    /* Carteirinha mobile adjustments */
    .carteirinha-card::before {
        height: 120px;
    }
    
    .header-pattern {
        height: 120px;
    }
    
    .timer-circle {
        width: 50px;
        height: 50px;
    }
    
    .foto-frame {
        border-width: 3px;
    }
}

/* PWA specific styles */
@media (display-mode: standalone) {
    /* Styles for when app is installed as PWA */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Dark mode support (future feature) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Print styles */
@media print {
    header, footer, .social-btn, .news-ticker {
        display: none !important;
    }
    
    .grid-container {
        display: block;
    }
    
    .grid-item {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    /* Hide everything on print for carteirinha */
    .carteirinha-page {
        display: none !important;
    }
}