/* Modern Variables for Better Design System */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --modern-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 8px 32px rgba(31, 38, 135, 0.37);
    --shadow-heavy: 0 15px 35px rgba(31, 38, 135, 0.5);
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--modern-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Enhanced for mobile scrolling */
    -webkit-overflow-scrolling: touch;
}

/* Container - MOBILE FIRST APPROACH */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Responsive breakpoints */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 3rem;
        gap: 2.5rem;
    }
}

/* Header Styles - Enhanced for Mobile */
.header {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease-out;
}

/* Mobile-first title sizing */
.title {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: titleGlow 3s ease-in-out infinite alternate;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
}

@media (min-width: 1024px) {
    .title {
        font-size: 3rem;
    }
}

.subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .subtitle {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}

/* Floating emoji animation */
.floating-emoji {
    font-size: 1.5rem;
    display: inline-block;
    animation: float 2s ease-in-out infinite;
    margin: 0 0.5rem;
}

@media (min-width: 768px) {
    .floating-emoji {
        font-size: 2rem;
    }
}

/* Main Content Area - FULLY RESPONSIVE */
.main-content {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    align-items: start;
}

/* Mobile: stack vertically */
@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .main-content {
        gap: 3rem;
    }
}

/* Wheel Section - Mobile Optimized */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    order: 1;
}

@media (min-width: 768px) {
    .wheel-section {
        order: 0;
        gap: 1.5rem;
    }
}

/* Wheel Container - Enhanced Glassmorphism */
.wheel-container {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    padding: 1rem;
    box-shadow: var(--shadow-heavy);
    animation: wheelGlow 4s ease-in-out infinite alternate;
    /* Mobile touch optimization */
    touch-action: manipulation;
}

/* Mobile-responsive wheel sizing */
.wheel-container {
    width: 300px;
    height: 300px;
}

@media (min-width: 768px) {
    .wheel-container {
        width: 420px;
        height: 420px;
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .wheel-container {
        width: 450px;
        height: 450px;
    }
}

/* Wheel Canvas - Responsive */
#wheelCanvas {
    border-radius: 50%;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    display: block;
    margin: 0 auto;
}

/* Enhanced Pointer - Multiple Layers */
.pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: pointerBounce 2s ease-in-out infinite;
}

.pointer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 25px solid #ff4757;
    filter: drop-shadow(0 4px 8px rgba(255, 71, 87, 0.4));
    z-index: 2;
}

.pointer::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid #ffffff;
    z-index: 3;
}

/* Mobile pointer adjustment */
@media (max-width: 767px) {
    .pointer::before {
        border-left-width: 10px;
        border-right-width: 10px;
        border-top-width: 20px;
    }
    .pointer::after {
        border-left-width: 8px;
        border-right-width: 8px;
        border-top-width: 16px;
    }
}

/* Spin Button - Touch-Friendly Mobile Design */
.spin-button {
    background: var(--accent-gradient);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 160px;
    position: relative;
    overflow: hidden;
    /* Mobile touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px; /* iOS touch target minimum */
}

@media (min-width: 768px) {
    .spin-button {
        padding: 1.2rem 2.5rem;
        font-size: 1.1rem;
        min-width: 180px;
    }
}

.spin-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.spin-button:hover::before {
    left: 100%;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 20px rgba(79, 172, 254, 0.4);
}

.spin-button:active {
    transform: translateY(-1px) scale(1.02);
}

.spin-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.button-emoji {
    font-size: 1.2rem;
    animation: buttonEmojiSpin 2s linear infinite;
}

@media (min-width: 768px) {
    .button-emoji {
        font-size: 1.4rem;
    }
}

/* Places Section - Mobile Optimized Layout */
.places-section {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    order: 0;
}

@media (min-width: 768px) {
    .places-section {
        order: 1;
        padding: 2rem;
    }
}

.places-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .places-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Places Grid - Mobile-First Responsive */
.places-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 1fr;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
    /* Custom scrollbar for mobile */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Two columns on larger mobile screens */
@media (min-width: 480px) {
    .places-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .places-grid {
        grid-template-columns: 1fr;
        max-height: 400px;
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .places-grid {
        max-height: 500px;
    }
}

/* Custom scrollbar styling */
.places-grid::-webkit-scrollbar {
    width: 6px;
}

.places-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.places-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.places-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Place Item - Enhanced Mobile Design */
.place-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    /* Mobile touch optimization */
    touch-action: manipulation;
}

.place-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.place-emoji {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

@media (min-width: 768px) {
    .place-emoji {
        font-size: 1.8rem;
    }
}

.place-name {
    font-weight: 600;
    color: white;
    font-size: 0.8rem;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .place-name {
        font-size: 0.9rem;
    }
}

/* Result Container - Mobile Optimized */
.result-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

.result-container.show {
    opacity: 1;
    visibility: visible;
}

/* Result Content - Mobile-First Design */
.result-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-heavy);
    transform: scale(0.8) translateY(50px);
    transition: var(--transition);
    max-width: 90vw;
    width: 100%;
    max-width: 400px;
}

.result-container.show .result-content {
    transform: scale(1) translateY(0);
}

.result-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: bounce 0.6s ease-out;
}

@media (min-width: 768px) {
    .result-emoji {
        font-size: 4rem;
        margin-bottom: 1.5rem;
    }
}

.result-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

@media (min-width: 768px) {
    .result-text {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Close Button - Touch-Friendly */
.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    /* Mobile touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Spinning Animation - Enhanced Performance */
.spinning {
    animation: spin var(--spin-duration, 3s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(var(--rotation-angle, 360deg));
    }
}

/* Enhanced Animations */
@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.2);
    }
    50% {
        text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.4);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wheelGlow {
    0%, 100% {
        box-shadow: var(--shadow-heavy), 0 0 30px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: var(--shadow-heavy), 0 0 50px rgba(102, 126, 234, 0.5);
    }
}

@keyframes pointerBounce {
    0%, 100% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes buttonEmojiSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Loading States - Mobile Optimized */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .place-item {
        border: 2px solid white;
    }
    
    .spin-button {
        border: 2px solid white;
    }
}

/* Focus indicators for keyboard navigation */
.spin-button:focus,
.maps-button:focus,
.result-maps-button:focus {
    outline: 2px solid #4facfe;
    outline-offset: 2px;
}

/* Safe area adjustments for mobile devices with notches */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
} 
} 