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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    background-attachment: fixed;
    min-height: 100vh;
    /* Disable gradient animation for better scroll performance */
    /* animation: gradientShift 15s ease infinite; */
}

/* Disabled for performance
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
*/

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.98);
    /* backdrop-filter: blur(10px); */ /* Disabled for performance */
    box-shadow: var(--shadow-md);
}

.main-nav {
    border-bottom: 1px solid var(--border-color);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    text-decoration: none;
    color: inherit;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.header-content {
    text-align: center;
    padding: 1.5rem 0;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* Main Content */
main {
    padding: 3rem 0;
}

/* Wheel Section */
.wheel-section {
    background: rgba(255, 255, 255, 0.98);
    /* backdrop-filter: blur(10px); */ /* Disabled for performance */
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
}

.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.wheel-wrapper {
    position: relative;
    display: inline-block;
}

.wheel {
    width: 500px;
    height: 500px;
    border-radius: 50%;
    box-shadow: var(--shadow-xl);
    will-change: transform;
    transition: transform 0.1s linear;
}

.wheel.spinning {
    transition: transform 3s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-empty {
    width: 100%;
    height: 100%;
    fill: #f3f4f6;
}

.wheel-empty-text {
    fill: #9ca3af;
    font-size: 24px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--primary-color);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.winner-display {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    color: white;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
}

.winner-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.winner-name {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.winner-name.highlight {
    animation: pulse 0.5s ease-in-out;
}

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

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-color), #f472b6);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--text-secondary);
}

/* Entries Section */
.entries-section {
    background: rgba(255, 255, 255, 0.98);
    /* backdrop-filter: blur(10px); */ /* Disabled for performance */
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
}

.entries-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.input-group {
    margin-bottom: 1.5rem;
}

#entriesInput {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

#entriesInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.help-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.entries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    min-height: 60px;
}

.entry-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.entry-tag .remove-entry {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.2s ease;
    padding: 0;
}

.entry-tag .remove-entry:hover {
    background: rgba(255, 255, 255, 0.5);
}

.empty-state {
    width: 100%;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
}

/* Page Content (for About, Privacy, Terms pages) */
.page-content {
    background: rgba(255, 255, 255, 0.98);
    /* backdrop-filter: blur(10px); */ /* Disabled for performance */
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    max-width: 900px;
    margin: 0 auto;
}

.page-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
}

.page-content section {
    margin-bottom: 2.5rem;
}

.page-content section:last-child {
    margin-bottom: 0;
}

.page-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.page-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.page-content ul,
.page-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.page-content li {
    margin-bottom: 0.5rem;
}

.page-content code {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.page-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Info Section */
.info-section {
    background: rgba(255, 255, 255, 0.98);
    /* backdrop-filter: blur(10px); */ /* Disabled for performance */
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
}

/* SEO Content Section */
.seo-content-section {
    background: rgba(255, 255, 255, 0.98);
    /* backdrop-filter: blur(10px); */ /* Disabled for performance */
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
}

.seo-content-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.seo-content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.seo-content-section a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.seo-content-section a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.info-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.info-section article {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.info-section article:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-section code {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.98);
    /* backdrop-filter: blur(10px); */ /* Disabled for performance */
    padding: 3rem 0 1.5rem;
    color: var(--text-secondary);
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-section p {
    margin: 0.5rem 0;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        /* backdrop-filter: blur(10px); */ /* Disabled for performance */
        flex-direction: column;
        padding: 1rem 0;
        gap: 0;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li {
        width: 100%;
        padding: 0.75rem 2rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a::after {
        display: none;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    main {
        padding: 1.5rem 0;
    }
    
    .wheel-section,
    .entries-section,
    .info-section {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    #wheelCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
    
    .winner-display {
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }
    
    .winner-name {
        font-size: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .info-section article {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .wheel {
        max-width: 300px;
    }
    
    .wheel-pointer {
        border-left-width: 15px;
        border-right-width: 15px;
        border-top-width: 30px;
        top: -15px;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
