/* Base Styles */
:root {
    --app-green: rgb(128, 182, 77); /* App green from AccentColor.colorset */
    --dark-bg: #121212;
    --dark-surface: #1e1e1e;
    --light-text: #ffffff;
    --gray-text: #a0a0a0;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--light-text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--light-text);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--app-green);
}

img {
    max-width: 100%;
    height: auto;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.chess-loader {
    width: 80px;
    height: 80px;
    position: relative;
}

.chess-piece {
    width: 100%;
    height: 100%;
    background-image: url('images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

/* Header */
header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color var(--transition-speed);
}

header.scrolled {
    background-color: rgba(30, 30, 30, 0.95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.logo-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    font-weight: 500;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--app-green);
    transition: width var(--transition-speed);
}

nav ul li a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 150px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    flex: 1;
    padding-right: 40px;
}

.hero-content h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--gray-text);
    margin-bottom: 30px;
    max-width: 500px;
}

.app-store-button {
    display: inline-block;
    transition: transform var(--transition-speed);
}

.app-store-button:hover {
    transform: scale(1.05);
}

.app-store-button img {
    height: 50px;
}

.app-store-button.large img {
    height: 60px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-height: 600px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

/* Features Section */
.features {
    padding: 100px 0;
    background-color: var(--dark-surface);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--app-green);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.feature-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon img {
    max-width: 100%;
    max-height: 100%;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--app-green);
}

.feature-card p {
    color: var(--gray-text);
}

/* Screenshots Section */
.screenshots {
    padding: 100px 0;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    justify-items: center;
}

.screenshot {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-speed);
}

.screenshot:hover {
    transform: scale(1.05);
}

.screenshot img {
    display: block;
    max-height: 600px;
}

/* Download Section */
.download {
    padding: 100px 0;
    text-align: center;
    background-color: var(--dark-surface);
}

.download p {
    font-size: 1.2rem;
    color: var(--gray-text);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
footer {
    padding: 60px 0 30px;
    background-color: var(--dark-bg);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
}

.logo-small {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.copyright {
    text-align: center;
    color: var(--gray-text);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
    }

    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }

    .logo-container {
        margin-bottom: 20px;
    }

    nav ul li {
        margin-left: 15px;
        margin-right: 15px;
    }

    .features-grid,
    .screenshots-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}