/* ===================================
   Mage Arena - Main Stylesheet
   =================================== */

/* CSS Variables */
:root {
    --bg-dark: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --accent-purple: #7b2cbf;
    --accent-blue: #3a86ff;
    --accent-gold: #ffd60a;
    --accent-red: #ff006e;
    --text-primary: #ffffff;
    --text-secondary: #d1d5db; /* Improved contrast from #b8b8d1 */
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    font-size: 16px; /* Prevent zoom on iOS */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
}

h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.8rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    z-index: 1000;
    border-bottom: 1px solid rgba(123, 44, 191, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-logo img {
    height: 40px;
    width: 40px;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent-gold);
}

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: rgba(26, 26, 46, 0.98);
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 1;
    border-radius: 5px;
    border: 1px solid rgba(123, 44, 191, 0.3);
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
}

.dropdown-menu li {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(123, 44, 191, 0.3);
    font-size: 0.9rem;
    margin-top: 60px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--accent-gold);
}

.breadcrumb span {
    color: var(--accent-gold);
}

/* Main Content */
main {
    padding-top: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Buttons */
.cta-button {
    display: inline-block;
    padding: 1rem 3rem;
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-blue));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 20px rgba(123, 44, 191, 0.4);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(123, 44, 191, 0.6);
}

.secondary-button {
    display: inline-block;
    padding: 1rem 3rem;
    background: transparent;
    color: var(--accent-gold);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    border: 2px solid var(--accent-gold);
    transition: all 0.3s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.secondary-button:hover {
    background: var(--accent-gold);
    color: var(--bg-dark);
    transform: translateY(-3px);
}

/* Footer */
footer {
    padding: 3rem 2rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(123, 44, 191, 0.3);
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo img {
    height: 32px;
    width: 32px;
}

.footer-logo span {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--accent-gold);
}

.footer-section h4 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: var(--accent-gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(123, 44, 191, 0.2);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-bottom a:hover {
    color: var(--accent-gold);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Navigation Mobile */
    .nav-container {
        padding: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.98);
        flex-direction: column;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(123, 44, 191, 0.3);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    nav ul.active {
        display: flex;
    }
    
    nav li {
        width: 100%;
    }
    
    nav a {
        padding: 1rem 2rem;
        display: block;
        font-size: 1.1rem;
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        background: rgba(26, 26, 46, 0.5);
        margin: 0;
        transform: none;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
    
    .dropdown-menu a {
        padding-left: 3rem;
        font-size: 1rem;
    }
    
    .dropdown:hover .dropdown-menu {
        display: none;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .nav-logo {
        font-size: 1.2rem;
    }
    
    .nav-logo img {
        height: 32px;
        width: 32px;
    }
    
    /* Typography Mobile */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Content Mobile */
    .container {
        padding: 1rem;
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Page-Specific Components */

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
}

.hero-left {
    text-align: left;
}

.hero h1 {
    font-family: 'Cinzel', serif;
    font-size: 4.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--accent-purple), var(--accent-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(123, 44, 191, 0.5);
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.features-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.features-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.features-list li:before {
    content: "✨";
    color: var(--accent-gold);
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-left {
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }
    
    .cta-button, .secondary-button {
        width: 100%;
        text-align: center;
        padding: 1.2rem 2rem;
        font-size: 1.1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1.1rem;
        line-height: 1.6;
    }
}

/* Steam Page Styles */
.steam-widget {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(123, 44, 191, 0.3);
    margin-bottom: 3rem;
}

.price-display {
    font-size: 3rem;
    color: var(--accent-gold);
    font-weight: 600;
    margin: 1rem 0;
}

.steam-button {
    display: inline-block;
    padding: 1rem 3rem;
    background: #171a21;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
    margin-top: 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.steam-button:hover {
    background: #2a475e;
}

.alert {
    background: rgba(255, 214, 10, 0.1);
    border: 1px solid var(--accent-gold);
    padding: 1rem;
    border-radius: 5px;
    margin: 2rem 0;
}

.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
}

.chart-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(123, 44, 191, 0.3);
}

@media (max-width: 768px) {
    .charts-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .price-display {
        font-size: 2.5rem;
    }
    
    .steam-button {
        display: block;
        width: 100%;
        text-align: center;
        padding: 1.2rem 2rem;
        font-size: 1.1rem;
        margin-top: 1.5rem;
    }
}

/* Spells Page Styles */
.spells-table {
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(123, 44, 191, 0.3);
    margin-bottom: 3rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: rgba(123, 44, 191, 0.2);
    padding: 1.5rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--accent-gold);
}

td {
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

tr:hover {
    background: rgba(58, 134, 255, 0.1);
}

.voice-command {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-family: monospace;
    color: var(--accent-gold);
    display: inline-block;
}

/* ===================================
   Section Layout Fixes
   =================================== */

/* Ensure all sections have proper centering */
.spells-section,
.gallery-section,
.platform-section,
.voice-demo {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    text-align: center;
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.spells-showcase,
.gallery-grid,
.platform-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.voice-demo {
    text-align: center;
}

.voice-demo p {
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* ===================================
   Accessibility Improvements
   =================================== */

/* Focus Indicators */
a:focus,
button:focus,
[onclick]:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Modern focus-visible support */
a:focus-visible,
button:focus-visible,
[onclick]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[onclick]:focus:not(:focus-visible) {
    outline: none;
}

/* Enhanced button focus styles */
.cta-button:focus,
.secondary-button:focus,
.demo-button:focus {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 214, 10, 0.4);
}

/* Platform card focus enhancement */
.platform-card:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 10px 30px rgba(255, 214, 10, 0.3);
}

/* Spell card focus enhancement */
.spell-card:focus-within {
    border-color: var(--accent-gold);
    transform: translateY(-8px);
}

/* Text contrast improvements are now in the main :root section above */

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #e5e7eb;
        --bg-secondary: #111827;
    }
    
    a:focus,
    button:focus,
    [onclick]:focus {
        outline: 4px solid #ffffff;
        outline-offset: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-gold);
    color: var(--bg-dark);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

@media (max-width: 768px) {
    .spells-table {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Ensure focus indicators are visible on mobile */
    a:focus,
    button:focus {
        outline-width: 2px;
        outline-offset: 1px;
    }
}