/**
 * BMW555 Website Styles
 * Mobile-first responsive design with s801- prefix
 * Color palette: #ECF0F1 | #4B0082 | #008B8B | #E0FFFF | #1C2833 | #EEEEEE
 */

/* CSS Variables for consistent theming */
:root {
    --s801-primary: #4B0082;
    --s801-secondary: #008B8B;
    --s801-accent: #E0FFFF;
    --s801-bg-dark: #1C2833;
    --s801-bg-light: #ECF0F1;
    --s801-text-light: #EEEEEE;
    --s801-text-dark: #1C2833;
    --s801-gradient: linear-gradient(135deg, #4B0082 0%, #008B8B 100%);
    --s801-shadow: 0 4px 20px rgba(75, 0, 130, 0.15);
    --s801-shadow-hover: 0 8px 30px rgba(75, 0, 130, 0.25);
    --s801-border-radius: 12px;
    --s801-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%; /* 1rem = 10px for easier calculations */
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.4rem;
    line-height: 1.5;
    color: var(--s801-text-dark);
    background: linear-gradient(135deg, var(--s801-bg-light) 0%, var(--s801-accent) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container and layout utilities */
.s801-container {
    max-width: 430px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.s801-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.s801-main {
    flex: 1;
    padding-bottom: 8rem; /* Space for bottom nav on mobile */
}

.s801-grid {
    display: grid;
    gap: 1.5rem;
}

.s801-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.s801-text-center {
    text-align: center;
}

/* Header and navigation */
.s801-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--s801-gradient);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--s801-shadow);
}

.s801-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.s801-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--s801-text-light);
    text-decoration: none;
}

.s801-logo img {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
}

.s801-nav-buttons {
    display: flex;
    gap: 1rem;
}

.s801-btn {
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: var(--s801-border-radius);
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--s801-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 4.4rem; /* Touch target size */
    min-width: 8rem;
}

.s801-btn-primary {
    background: var(--s801-secondary);
    color: var(--s801-text-light);
    box-shadow: var(--s801-shadow);
}

.s801-btn-primary:hover {
    background: #006666;
    transform: translateY(-2px);
    box-shadow: var(--s801-shadow-hover);
}

.s801-btn-outline {
    background: transparent;
    color: var(--s801-text-light);
    border: 2px solid var(--s801-text-light);
}

.s801-btn-outline:hover {
    background: var(--s801-text-light);
    color: var(--s801-primary);
}

.s801-hamburger {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 4.4rem;
    min-height: 4.4rem;
}

.s801-hamburger span {
    width: 2.4rem;
    height: 0.3rem;
    background: var(--s801-text-light);
    transition: var(--s801-transition);
    border-radius: 2px;
}

.s801-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--s801-bg-dark);
    z-index: 9999;
    transition: var(--s801-transition);
    padding: 2rem;
    overflow-y: auto;
}

.s801-menu-open {
    right: 0;
}

.s801-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: var(--s801-transition);
}

.s801-overlay-active {
    opacity: 1;
    visibility: visible;
}

.s801-menu-list {
    list-style: none;
    margin-top: 3rem;
}

.s801-menu-item {
    margin-bottom: 1.5rem;
}

.s801-menu-link {
    color: var(--s801-text-light);
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 500;
    padding: 1rem 0;
    display: block;
    transition: var(--s801-transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.s801-menu-link:hover {
    color: var(--s801-accent);
    padding-left: 1rem;
}

/* Hero carousel */
.s801-hero {
    margin-top: 7rem;
    margin-bottom: 3rem;
}

.s801-carousel {
    position: relative;
    width: 100%;
    height: 20rem;
    border-radius: var(--s801-border-radius);
    overflow: hidden;
    box-shadow: var(--s801-shadow);
}

.s801-carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.s801-carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.s801-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.s801-carousel-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
}

.s801-carousel-dot {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--s801-transition);
}

.s801-dot-active {
    background: var(--s801-accent);
    transform: scale(1.2);
}

/* Typography */
.s801-h1 {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--s801-primary);
    margin-bottom: 2rem;
    line-height: 1.2;
}

.s801-h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--s801-primary);
    margin-bottom: 1.5rem;
}

.s801-h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--s801-secondary);
    margin-bottom: 1rem;
}

.s801-text {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--s801-text-dark);
}

.s801-text-small {
    font-size: 1.2rem;
    color: #666;
}

/* Cards and components */
.s801-card {
    background: white;
    border-radius: var(--s801-border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--s801-shadow);
    transition: var(--s801-transition);
}

.s801-card:hover {
    box-shadow: var(--s801-shadow-hover);
    transform: translateY(-2px);
}

.s801-section {
    margin-bottom: 3rem;
}

/* Game grid and items */
.s801-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.s801-game-item {
    background: white;
    border-radius: var(--s801-border-radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--s801-transition);
    box-shadow: var(--s801-shadow);
    text-decoration: none;
    display: block;
}

.s801-game-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--s801-shadow-hover);
}

.s801-game-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 0.8rem;
    border-radius: var(--s801-border-radius);
    object-fit: cover;
}

.s801-game-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--s801-text-dark);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Bottom navigation */
.s801-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--s801-bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0.8rem 0;
    backdrop-filter: blur(10px);
}

.s801-bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 430px;
    margin: 0 auto;
}

.s801-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 6rem;
    min-height: 5.6rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--s801-transition);
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1rem;
}

.s801-bottom-nav-item:hover,
.s801-bottom-nav-item.s801-nav-active {
    color: var(--s801-accent);
    transform: scale(1.05);
}

.s801-bottom-nav-icon {
    font-size: 2.4rem;
    margin-bottom: 0.3rem;
    transition: var(--s801-transition);
}

.s801-bottom-nav-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Footer */
.s801-footer {
    background: var(--s801-bg-dark);
    color: var(--s801-text-light);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.s801-footer-content {
    text-align: center;
}

.s801-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.s801-footer-link {
    color: var(--s801-text-light);
    text-decoration: none;
    font-size: 1.3rem;
    transition: var(--s801-transition);
}

.s801-footer-link:hover {
    color: var(--s801-accent);
}

.s801-partners {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.s801-partner {
    width: 4rem;
    height: 4rem;
    border-radius: var(--s801-border-radius);
    object-fit: contain;
    background: white;
    padding: 0.5rem;
}

.s801-copyright {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2rem;
}

/* Utility classes */
.s801-mb-1 { margin-bottom: 1rem; }
.s801-mb-2 { margin-bottom: 2rem; }
.s801-mb-3 { margin-bottom: 3rem; }
.s801-mt-1 { margin-top: 1rem; }
.s801-mt-2 { margin-top: 2rem; }
.s801-mt-3 { margin-top: 3rem; }

.s801-p-1 { padding: 1rem; }
.s801-p-2 { padding: 2rem; }
.s801-p-3 { padding: 3rem; }

.s801-hidden {
    display: none;
}

.s801-loading {
    opacity: 0.6;
    pointer-events: none;
}

.s801-error {
    border-color: #e74c3c !important;
    background-color: #fdf2f2;
}

.s801-error-message {
    background: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: var(--s801-border-radius);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.s801-lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Responsive design */
@media (max-width: 768px) {
    .s801-hamburger {
        display: flex;
    }

    .s801-nav-buttons {
        display: none;
    }

    .s801-main {
        padding-bottom: 8rem;
    }

    .s801-container {
        padding: 0 1rem;
    }

    .s801-h1 {
        font-size: 2rem;
    }

    .s801-h2 {
        font-size: 1.7rem;
    }

    .s801-carousel {
        height: 16rem;
    }

    .s801-game-grid {
        grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
        gap: 0.8rem;
    }

    .s801-card {
        padding: 1.5rem;
    }

    .s801-bottom-nav {
        display: block;
    }
}

@media (min-width: 769px) {
    .s801-bottom-nav {
        display: none;
    }

    .s801-main {
        padding-bottom: 0;
    }
}

/* Print styles */
@media print {
    .s801-header,
    .s801-bottom-nav,
    .s801-mobile-menu,
    .s801-menu-overlay {
        display: none;
    }

    .s801-main {
        padding-bottom: 0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --s801-primary: #000080;
        --s801-secondary: #008000;
        --s801-text-dark: #000000;
        --s801-text-light: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--s801-bg-dark);
        color: var(--s801-text-light);
    }

    .s801-card {
        background: rgba(255, 255, 255, 0.1);
        color: var(--s801-text-light);
    }

    .s801-game-item {
        background: rgba(255, 255, 255, 0.1);
        color: var(--s801-text-light);
    }

    .s801-text {
        color: var(--s801-text-light);
    }
}