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

/* Accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--neon-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* Focus management */
*:focus {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
}

.nav-link:focus,
.feature-card:focus,
.spin-button:focus,
.center-circle:focus {
    outline: 3px solid var(--neon-yellow);
    outline-offset: 3px;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    --warning-gradient: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --danger-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --neon-blue: #00f5ff;
    --neon-pink: #ff00ff;
    --neon-green: #39ff14;
    --neon-yellow: #ffff00;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --shadow-dark: rgba(0, 0, 0, 0.3);
    --shadow-light: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-pink));
    filter: blur(1px);
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 20%;
    right: 15%;
    animation-delay: -5s;
    animation-duration: 30s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 30%;
    left: 20%;
    animation-delay: -10s;
    animation-duration: 22s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    bottom: 20%;
    right: 25%;
    animation-delay: -15s;
    animation-duration: 28s;
}

.shape-5 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    animation-delay: -20s;
    animation-duration: 35s;
}

.shape-6 {
    width: 90px;
    height: 90px;
    top: 70%;
    right: 10%;
    animation-delay: -8s;
    animation-duration: 26s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(30px, -30px) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg) scale(0.9);
    }
    75% {
        transform: translate(40px, 10px) rotate(270deg) scale(1.05);
    }
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideInFromTop 1s ease-out;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-weight: 600;
    border: 1px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-link.active {
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-pink));
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.3);
}

/* Header Styles */
.header {
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
}

.header-content {
    animation: slideInFromTop 1s ease-out;
}

.main-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--text-light);
    text-shadow: 
        0 0 10px var(--neon-blue),
        0 0 20px var(--neon-blue),
        0 0 30px var(--neon-blue),
        3px 3px 6px var(--shadow-dark);
    margin-bottom: 1rem;
    position: relative;
}

.title-emoji {
    display: inline-block;
    animation: bounce 2s infinite;
    font-size: 1.2em;
}

.title-emoji:first-child {
    animation-delay: 0s;
}

.title-emoji:last-child {
    animation-delay: 0.5s;
}

.title-text {
    background: linear-gradient(45deg, var(--neon-yellow), var(--neon-pink), var(--neon-blue));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-light);
    opacity: 0.9;
    font-weight: 300;
    text-shadow: 2px 2px 4px var(--shadow-dark);
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Spinner Styles */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3rem 0;
    perspective: 1000px;
}

.spinner-wrapper {
    position: relative;
    width: clamp(300px, 50vw, 500px);
    height: clamp(300px, 50vw, 500px);
    animation: pulse 4s ease-in-out infinite;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(
        from 0deg,
        #ff6b6b 0deg 45deg,
        #4ecdc4 45deg 90deg,
        #45b7d1 90deg 135deg,
        #96ceb4 135deg 180deg,
        #feca57 180deg 225deg,
        #ff9ff3 225deg 270deg,
        #54a0ff 270deg 315deg,
        #5f27cd 315deg 360deg
    );
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.3),
        0 0 60px rgba(255, 255, 255, 0.2),
        inset 0 0 30px rgba(0, 0, 0, 0.1);
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.spinner-section {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(0.7rem, 2vw, 1.1rem);
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
    overflow: hidden;
}

.spinner-section:nth-child(1) { transform: rotate(0deg); }
.spinner-section:nth-child(2) { transform: rotate(45deg); }
.spinner-section:nth-child(3) { transform: rotate(90deg); }
.spinner-section:nth-child(4) { transform: rotate(135deg); }
.spinner-section:nth-child(5) { transform: rotate(180deg); }
.spinner-section:nth-child(6) { transform: rotate(225deg); }
.spinner-section:nth-child(7) { transform: rotate(270deg); }
.spinner-section:nth-child(8) { transform: rotate(315deg); }

.section-text {
    transform: rotate(-22.5deg);
    white-space: nowrap;
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spinner-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}

.pointer-triangle {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--neon-yellow);
    position: relative;
    animation: pointerGlow 2s ease-in-out infinite alternate;
}

.pointer-triangle::after {
    content: '';
    position: absolute;
    top: -40px;
    left: -15px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--text-light);
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.center-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.1);
    animation: centerPulse 3s ease-in-out infinite;
}

.center-circle:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.6),
        inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.center-text {
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* Question Section */
.question-section {
    display: flex;
    justify-content: center;
    margin: 2rem 1rem;
    animation: fadeInUp 1s ease-out 1s both;
}

.question-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.question-input {
    width: 100%;
    padding: 1.5rem 2rem;
    font-size: clamp(1rem, 3vw, 1.3rem);
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    outline: none;
}

.question-input:focus {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 20px var(--neon-blue),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.question-input::placeholder {
    color: rgba(44, 62, 80, 0.6);
    font-style: italic;
}

.input-decoration {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 55px;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-pink), var(--neon-green), var(--neon-yellow));
    background-size: 400% 400%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientRotate 3s ease-in-out infinite;
}

.question-input:focus + .input-decoration {
    opacity: 0.7;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    margin: 3rem 1rem;
    animation: fadeInUp 1s ease-out 1.5s both;
}

.spin-button {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-blue));
    color: var(--text-light);
    border: none;
    padding: 1.5rem 3rem;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Fredoka One', cursive;
}

.spin-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px var(--neon-pink);
}

.spin-button:active {
    transform: translateY(-2px) scale(1.02);
}

.button-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    color: var(--neon-yellow);
    animation: sparkleFloat 2s ease-in-out infinite;
    font-size: 1.2em;
}

.sparkle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    top: 60%;
    right: 20%;
    animation-delay: 0.7s;
}

.sparkle:nth-child(3) {
    bottom: 20%;
    left: 50%;
    animation-delay: 1.4s;
}

/* Result Section */
.result-section {
    display: flex;
    justify-content: center;
    margin: 3rem 1rem;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.result-section.show {
    opacity: 1;
    transform: translateY(0);
    animation: resultReveal 0.8s ease-out;
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 400px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 2s ease-in-out infinite;
}

.result-emoji {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 1rem;
    animation: emojiDance 1s ease-in-out infinite;
}

.result-text {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--neon-pink), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-subtext {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: rgba(44, 62, 80, 0.7);
    font-weight: 300;
    line-height: 1.6;
}

/* Features Preview */
.features-preview {
    margin: 4rem 1rem 2rem;
    text-align: center;
    animation: fadeInUp 1s ease-out 2s both;
}

.features-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--text-light);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px var(--shadow-dark);
    font-family: 'Fredoka One', cursive;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

.feature-card:nth-child(1) .feature-icon { animation-delay: 0s; }
.feature-card:nth-child(2) .feature-icon { animation-delay: 0.2s; }
.feature-card:nth-child(3) .feature-icon { animation-delay: 0.4s; }
.feature-card:nth-child(4) .feature-icon { animation-delay: 0.6s; }

.feature-name {
    color: var(--text-light);
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 1px 1px 2px var(--shadow-dark);
    margin-bottom: 0.5rem;
}

.feature-desc {
    color: var(--text-light);
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 300;
    text-shadow: 1px 1px 2px var(--shadow-dark);
    line-height: 1.3;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

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

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.footer-icons span {
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

.footer-icons span:nth-child(1) { animation-delay: 0s; }
.footer-icons span:nth-child(2) { animation-delay: 0.3s; }
.footer-icons span:nth-child(3) { animation-delay: 0.6s; }
.footer-icons span:nth-child(4) { animation-delay: 0.9s; }

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

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

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

@keyframes pointerGlow {
    from {
        filter: drop-shadow(0 0 5px var(--neon-yellow));
    }
    to {
        filter: drop-shadow(0 0 20px var(--neon-yellow));
    }
}

@keyframes centerPulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(255, 255, 255, 0.4),
            inset 0 0 20px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(255, 255, 255, 0.6),
            inset 0 0 20px rgba(0, 0, 0, 0.1);
    }
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-10px) scale(1.2);
        opacity: 1;
    }
}

@keyframes resultReveal {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-10px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes emojiDance {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-5deg) scale(1.1);
    }
    75% {
        transform: rotate(5deg) scale(1.1);
    }
}

@keyframes spinWheel {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(var(--spin-rotation));
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-bar {
        gap: 0.5rem;
        padding: 0.7rem;
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .main-title {
        font-size: 2.5rem;
    }
    
    .spinner-wrapper {
        width: 280px;
        height: 280px;
    }
    
    .center-circle {
        width: 60px;
        height: 60px;
    }
    
    .center-text {
        font-size: 0.7rem;
    }
    
    .feature-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-card {
        margin: 0 1rem;
    }
}

@media (max-width: 480px) {
    .nav-bar {
        gap: 0.3rem;
        padding: 0.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    .header {
        padding: 1rem 0.5rem;
    }
    
    .spinner-wrapper {
        width: 250px;
        height: 250px;
    }
    
    .question-input {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .spin-button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .result-card {
        padding: 2rem 1.5rem;
    }
}

/* Loading Animation */
.spinner-circle.spinning {
    animation: spinWheel 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Confetti Effect */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--neon-pink);
    animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}
