/* Optimized CSS - Extracted from Tailwind and custom styles */

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

/* Font Loading - Optimized */
body {
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
}

/* Utility Classes (Extracted from Tailwind) */
.hidden { display: none; }
.relative { position: relative; }
.z-10 { z-index: 10; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-4xl { max-width: 56rem; }
.min-h-screen { min-height: 100vh; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.pt-4 { padding-top: 1rem; }
.p-4 { padding: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.text-center { text-align: center; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.leading-tight { line-height: 1.25; }
.text-pink-600 { color: rgb(219, 39, 119); }
.text-pink-500 { color: rgb(236, 72, 153); }
.text-white { color: white; }
.text-green-700 { color: rgb(21, 128, 61); }
.text-yellow-700 { color: rgb(161, 98, 7); }
.text-red-700 { color: rgb(185, 28, 28); }
.bg-white { background-color: white; }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-green-100 { --tw-gradient-from: rgb(220, 252, 231); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-emerald-100 { --tw-gradient-to: rgb(209, 250, 229); }
.from-yellow-100 { --tw-gradient-from: rgb(254, 249, 195); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-amber-100 { --tw-gradient-to: rgb(254, 243, 199); }
.from-red-100 { --tw-gradient-from: rgb(254, 226, 226); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-rose-100 { --tw-gradient-to: rgb(255, 228, 230); }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Gradient Background with GPU Acceleration */
.gradient-bg {
    background: linear-gradient(-45deg, #fce7f3, #fce4ec, #f3e5f5, #fce7f3);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    position: relative;
    will-change: background-position;
}

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

/* Floating Elements - Optimized for GPU */
.floating {
    position: absolute;
    pointer-events: none;
    opacity: 0.4;
    animation: float 6s ease-in-out infinite;
    font-size: 3rem;
    will-change: transform;
    transform: translateZ(0); /* Force GPU acceleration */
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg) translateZ(0); }
    50% { transform: translateY(-20px) rotate(10deg) translateZ(0); }
}

.floating:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating:nth-child(2) { top: 20%; right: 10%; animation-delay: 1s; }
.floating:nth-child(3) { top: 60%; left: 5%; animation-delay: 2s; }
.floating:nth-child(4) { top: 70%; right: 15%; animation-delay: 3s; }

/* Card Styles - GPU Optimized */
.card-hover {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: visible;
    will-change: transform;
    transform: translateZ(0);
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(219, 39, 119, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    will-change: opacity;
}

.card-hover:hover::before {
    opacity: 1;
}

/* Sparkle Animation */
.sparkle {
    display: inline-block;
    animation: sparkle 2s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2) rotate(180deg);
    }
}

/* Voted Card Style */
.voted {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.5); }
    50% { box-shadow: 0 0 40px rgba(236, 72, 153, 0.8); }
}

/* Emoji Bounce */
.emoji-bounce {
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
    will-change: transform;
}

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

/* Fade In Animation */
.fade-in {
    animation: fadeIn 1s ease-out;
}

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

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

/* Title Glow */
.title-glow {
    text-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px rgba(236, 72, 153, 0.5); }
    50% { text-shadow: 0 0 40px rgba(236, 72, 153, 0.8); }
}

/* Vote Count Update Animation */
.vote-count-update {
    animation: countPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes countPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Heart Badge Styles - GPU Optimized */
.heart-badge {
    position: absolute;
    top: -12px;
    left: -12px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    z-index: 10;
    animation: heartBeatSmooth 2.5s ease-in-out infinite;
    border: 3px solid white;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    opacity: 1 !important;
    will-change: transform;
    transform: translateZ(0);
}

.heart-badge-voted {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    animation: heartBeatVoted 2s ease-in-out infinite;
}

@keyframes heartBeatSmooth {
    0%, 100% {
        transform: scale(1) translateZ(0);
        box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    }
    50% {
        transform: scale(1.08) translateZ(0);
        box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
    }
}

@keyframes heartBeatVoted {
    0%, 100% {
        transform: scale(1) translateZ(0);
        box-shadow: 0 6px 25px rgba(251, 191, 36, 0.6);
    }
    50% {
        transform: scale(1.1) translateZ(0);
        box-shadow: 0 8px 30px rgba(251, 191, 36, 0.7);
    }
}

.heart-icon {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.heart-count {
    font-size: 0.9rem;
    font-weight: 800;
    margin-top: 3px;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    line-height: 1;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Responsive Styles */
@media (min-width: 640px) {
    .sm\:py-8 { padding-top: 2rem; padding-bottom: 2rem; }
    .sm\:px-4 { padding-left: 1rem; padding-right: 1rem; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:p-6 { padding: 1.5rem; }
    .sm\:mb-4 { margin-bottom: 1rem; }
    .sm\:mb-6 { margin-bottom: 1.5rem; }
    .sm\:mb-8 { margin-bottom: 2rem; }
    .sm\:mb-12 { margin-bottom: 3rem; }
    .sm\:mt-6 { margin-top: 1.5rem; }
    .sm\:gap-8 { gap: 2rem; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .sm\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .sm\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .sm\:rounded-2xl { border-radius: 1rem; }
    .sm\:rounded-3xl { border-radius: 1.5rem; }

    .floating {
        opacity: 0.6;
        font-size: 4rem;
    }

    .heart-badge {
        width: 75px;
        height: 75px;
        top: -15px;
        left: -15px;
    }

    .heart-icon {
        font-size: 1.875rem;
    }

    .heart-count {
        font-size: 1.125rem;
        margin-top: 4px;
    }
}

@media (min-width: 768px) {
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .md\:text-7xl { font-size: 4.5rem; line-height: 1; }
    .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .md\:p-10 { padding: 2.5rem; }

    .card-hover:hover {
        transform: translateY(-15px) scale(1.02) translateZ(0);
        box-shadow: 0 30px 60px rgba(236, 72, 153, 0.4);
    }
}

@media (min-width: 1024px) {
    .lg\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .title-glow {
        font-size: 2rem !important;
        line-height: 1.3;
    }

    .mobile-subtitle {
        font-size: 1.125rem !important;
    }

    .card-hover:active {
        transform: scale(0.98) translateZ(0);
        box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
    }
}
