/* ============================================
   Tixvnt Attendance Flyer Generator 2.0
   Premium Gen-Z Social Sharing Experience
   ============================================ */

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

:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header .logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.app-header .logo span {
    font-weight: 700;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #FF5F00, #FF008C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom select styling (Bootstrap override) */
.theme-selector .form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    width: auto;
    min-width: 150px;
}

.theme-selector .form-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Flyer Container - Story Optimized */
.flyer-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: all 0.5s ease;
}

/* Background Layer */
.flyer-container .background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: all 0.5s ease;
}

/* Theme: Neon Festival */
.theme-neon .background-layer {
    background: radial-gradient(circle at 30% 20%, #FF5F00 0%, transparent 40%),
                radial-gradient(circle at 70% 80%, #FF008C 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, #7B2FFF 0%, transparent 30%),
                radial-gradient(circle at 20% 70%, #00D9FF 0%, transparent 40%);
    animation: neonMesh 8s ease-in-out infinite alternate;
}

/* Theme: Glass Luxury */
.theme-glass .background-layer {
    background: linear-gradient(135deg, #F5F7FA 0%, #E8EDF9 50%, #C9D6FF 100%);
    animation: auroraFlow 10s ease-in-out infinite alternate;
}

/* Theme: Spotify Wrapped */
.theme-spotify .background-layer {
    background: linear-gradient(45deg, #1ED760 0%, #FF4D6D 50%, #7B61FF 100%);
    animation: meshGradient 6s ease-in-out infinite alternate;
}

/* Theme: Cyber Takeover */
.theme-cyber .background-layer {
    background: linear-gradient(135deg, #0D0D0D 0%, #1a1a1a 50%, #0a0a0a 100%);
    background-image: 
        repeating-linear-gradient(90deg, transparent 0, transparent 19px, rgba(255, 85, 0, 0.1) 20px),
        repeating-linear-gradient(0deg, transparent 0, transparent 19px, rgba(255, 85, 0, 0.1) 20px),
        radial-gradient(circle at 50% 50%, #FF5500 0%, transparent 60%);
    animation: cyberGrid 4s linear infinite;
}

/* Gradient Layer */
.flyer-container .gradient-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    transition: all 0.5s ease;
}

/* Theme: Neon Festival Gradient */
.theme-neon .gradient-layer {
    background: radial-gradient(circle at 50% 30%, rgba(255, 95, 0, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 0, 140, 0.2) 0%, transparent 40%);
    animation: gradientShift 6s ease-in-out infinite;
}

/* Theme: Glass Luxury Gradient */
.theme-glass .gradient-layer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    animation: auroraFlow 8s ease-in-out infinite;
}

/* Theme: Spotify Wrapped Gradient */
.theme-spotify .gradient-layer {
    background: radial-gradient(circle at 30% 70%, rgba(30, 215, 96, 0.4) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255, 77, 109, 0.3) 0%, transparent 40%);
    animation: blobMove 8s ease-in-out infinite;
}

/* Theme: Cyber Takeover Gradient */
.theme-cyber .gradient-layer {
    background: radial-gradient(circle at 50% 50%, rgba(255, 85, 0, 0.2) 0%, transparent 60%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.1) 0%, transparent 50%, rgba(255, 0, 0, 0.1) 100%);
    animation: scanLines 4s linear infinite;
}

/* Noise Overlay */
.flyer-container .noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Particles Container */
.flyer-container .particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

/* Theme: Neon Festival Particles */
.theme-neon .particles-container .particle {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    animation: floatParticle 6s ease-in-out infinite;
}

/* Theme: Glass Luxury Particles */
.theme-glass .particles-container .particle {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    animation: floatParticle 8s ease-in-out infinite;
}

/* Theme: Spotify Wrapped Particles */
.theme-spotify .particles-container .particle {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, transparent 70%);
    animation: floatParticle 5s ease-in-out infinite;
}

/* Theme: Cyber Takeover Particles */
.theme-cyber .particles-container .particle {
    background: radial-gradient(circle, rgba(255, 85, 0, 0.8) 0%, transparent 70%);
    animation: floatParticle 4s ease-in-out infinite;
}

/* ---------------------------------------------------------------
   Theme‑specific flyer element overrides
   --------------------------------------------------------------- */


/* Spotify Wrapped */
.theme-spotify .event-flyer-blur img {
    filter: blur(8px) saturate(1.2);
}
.theme-spotify .qr-code {
    background: rgba(255, 77, 109, 0.9);
}
.theme-spotify .ticket-serial {
    color: #ff4d6d;
}

/* Dynamic Island */
.attendance-flyer-div-inner .dynamic-island {
    animation: islandFloat 4s ease-in-out infinite;
}

.attendance-flyer-div-inner .island-text {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); */
    box-shadow: 0 2px 10px rgba(30, 215, 96, 0.4);

    white-space: nowrap;
}

.attendance-flyer-div-inner .island-glow {
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 12px #00ff88;
    animation: pulse 2s ease-in-out infinite;
}

/* Event Flyer Blur */
.flyer-container .event-flyer-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    overflow: hidden;
}

.flyer-container .event-flyer-blur img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) scale(1.1);
    animation: slowZoom 20s ease-in-out infinite;
}

/* Event Flyer Foreground */
.flyer-container .event-flyer-foreground {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    overflow: hidden;
}
.flyer-container .event-flyer-foreground img {
    animation: floatCard 6s ease-in-out infinite;
}

.flyer-container .glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Event Details */
.flyer-container .event-details {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    text-align: center;
    width: 90%;
    animation: slideInUp 1s ease-out 0.3s both;
}

.flyer-container .event-name {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
    line-height: 1.2;
}

.flyer-container .event-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.flyer-container .meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.flyer-container .meta-item .icon {
    font-size: 1.2rem;
}

/* QR Section */
.flyer-container .qr-section {
    position: absolute;
    bottom: 15%;
    right: 20px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: slideInRight 1s ease-out 0.5s both;
}

.flyer-container .qr-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.flyer-container .qr-code {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: qrPulse 3s ease-in-out infinite;
}

.flyer-container .qr-code svg {
    width: 100% !important;
    height: 100% !important;
}

.flyer-container .qr-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.flyer-container .ticket-serial {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Social Stickers */
.flyer-container .social-stickers {
    position: absolute;
    bottom: 10%;
    left: 20px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideInLeft 1s ease-out 0.4s both;
}

.flyer-container .sticker {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: rotate(-2deg);
    animation: stickerFloat 4s ease-in-out infinite;
}

.flyer-container .sticker:nth-child(2) {
    transform: rotate(2deg);
    animation-delay: 2s;
}

/* Powered By */
.flyer-container .powered-by {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    animation: fadeIn 1s ease-out 0.8s both;
}

.flyer-container .powered-by span {
    margin-right: 4px;
}

.flyer-container .powered-by a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    text-decoration: underline;
}

/* Controls */
.controls {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    z-index: 100;
}

/* Bootstrap button override */
.btn-download {
    background: linear-gradient(135deg, #FF5F00, #FF008C); /* Neon Festival */
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 0.85rem;
    box-shadow: 0 8px 24px rgba(255, 95, 0, 0.4);
    animation: fadeIn 1s ease-out 1s both;
    text-decoration: none;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 95, 0, 0.5);
}

.btn-download:active {
    transform: translateY(0);
}

/* Spotify Wrapped */
.theme-spotify .btn-download {
    background: linear-gradient(135deg, #1ED760, #FF4D6D);
    color: white;
    box-shadow: 0 8px 24px rgba(30, 215, 96, 0.4);
}

.theme-spotify .btn-download:hover {
    box-shadow: 0 12px 32px rgba(30, 215, 96, 0.5);
}

.theme-spotify .btn-download svg {
    stroke: white;
}

/* Animations */
@keyframes neonMesh {
    0% { filter: hue-rotate(0deg) brightness(1); }
    100% { filter: hue-rotate(60deg) brightness(1.1); }
}

@keyframes auroraFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes meshGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes cyberGrid {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, 2px); }
    50% { transform: translate(0, 4px); }
    75% { transform: translate(-2px, 2px); }
    100% { transform: translate(0, 0); }
}

@keyframes gradientShift {
    0% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
    100% { opacity: 0.3; transform: scale(1); }
}

@keyframes slowZoom {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes floatCard {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-10px); }
}

@keyframes islandFloat {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(0) translateY(-8px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

@keyframes floatParticle {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-100px) translateX(20px); opacity: 0; }
}

@keyframes qrPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
}

@keyframes stickerFloat {
    0%, 100% { transform: rotate(-2deg) translateY(0); }
    50% { transform: rotate(-2deg) translateY(-5px); }
}

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

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* Responsive Adjustments */
@media (max-width: 480px) {
    .app-header {
        padding: 15px;
    }
    
    .app-header .logo span {
        font-size: 1rem;
    }
    
    .flyer-container {
        max-width: 100%;
        aspect-ratio: 9 / 16;
        border-radius: 0;
        box-shadow: none;
    }
    
    .btn-download {
        font-size: 0.85rem;
    }
    
    .theme-selector .form-select {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .app-header, .controls {
        display: none !important;
    }
    
    .flyer-container {
        max-width: 100%;
        box-shadow: none;
        border-radius: 0;
    }
}

/* Bootstrap Custom Overrides */
.btn {
    font-weight: 600;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.form-select {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.form-select:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.form-select option {
    background-color: #0a0a0a;
    color: white;
}

/* Custom utility classes */
.text-gradient {
    background: linear-gradient(135deg, #FF5F00, #FF008C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 8px 24px rgba(255, 95, 0, 0.4);
}

.shadow-glow:hover {
    box-shadow: 0 12px 32px rgba(255, 95, 0, 0.5);
}

.generate-attendance-flyer-modal .modal-content {
    width: 90%;
}