/* 
 * DCSO Studio - Official Website Styles
 * Theme: Premium Royal (Dark Blue + Gold)
 */

:root {
    /* Colors */
    --primary-web: #0f172a;
    /* Dark Slate Blue */
    --primary-dark: #020617;
    /* Almost Black */
    --accent-gold: #d4af37;
    /* Royal Gold */
    --accent-gold-hover: #b5952f;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Spacing */
    --section-padding: 5rem 2rem;
    --container-width: 1200px;

    /* Transitions */
    --transition-fast: 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--primary-dark);
    color: var(--text-light);
    font-family: 'Cairo', 'Inter', sans-serif;
    /* RTL focused */
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 3rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 2px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--section-padding);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(45deg, var(--accent-gold), #f1c40f);
    color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.btn-outline {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: transparent;
}

.btn-outline:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.85);
    /* Glass effect */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-fast);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
}

.navbar .logo {
    height: 100%;
}

.logo img {
    height: 60px;
    /* حجم أكبر قليلاً لوضوح أفضل */
    width: auto;
    display: block;
    transition: transform var(--transition-fast);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a:hover::after {
    width: 100%;
    left: 0;
    /* RTL origin */
}

/* Nav Buttons */
.nav-btn {
    padding: 0.5rem 1.5rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all var(--transition-fast) !important;
    border: 1px solid transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn::after {
    display: none !important;
}

.nav-btn-login {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
}

.nav-btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold) !important;
    color: var(--accent-gold) !important;
}

.nav-btn-register {
    background: var(--accent-gold);
    color: var(--primary-dark) !important;
    border-color: var(--accent-gold) !important;
}

.nav-btn-register:hover {
    background: var(--accent-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(2, 6, 23, 0.7), rgba(2, 6, 23, 0.8)), url('../assets/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 2;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    /* iOS style rounded corners */
    padding: 2rem;
    backdrop-filter: blur(5px);
}

/* Games Section */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
    /* Center cards if they don't fill the row */
}

.game-card {
    background: var(--primary-web);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    max-width: 400px;
    /* Prevent card from becoming too wide */
    width: 100%;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-gold);
}

.game-image {
    height: 200px;
    background-color: #1e293b;
    /* Placeholder */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.game-info {
    padding: 1.5rem;
}

.game-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.game-info p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.feature-box {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    transition: var(--transition-fast);
}

.feature-box:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: #000;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-column h4 {
    margin-bottom: 1.5rem;
    color: var(--accent-gold);
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text-light);
    padding-right: 5px;
    /* RTL Slide */
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.social-icon:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Languages / Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

/* RTL Support Defaults */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .nav-links a::after {
    right: auto;
    left: 0;
}

[dir="rtl"] .nav-links a:hover::after {
    right: 0;
}

[dir="rtl"] .footer-links a:hover {
    padding-right: 0;
    padding-left: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        right: -100%;
        /* Start hidden off-screen */
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--primary-dark);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.4s ease;
        border-top: 1px solid var(--glass-border);
    }

    .nav-links.active {
        right: 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    /* Glass effect */
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Form Grid for Desktop */
@media (min-width: 768px) {
    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.close-modal:hover {
    color: var(--text-light);
    background: rgba(255, 0, 0, 0.2);
}

/* Auth Modal Specifics */
.auth-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-form .form-group {
    text-align: right;
    margin-bottom: 1.25rem;
}

.auth-form .form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

.auth-form .form-control:focus {
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.05);
}

.pw-wrapper {
    position: relative;
}

.pw-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}

.pw-icon:hover {
    color: var(--accent-gold);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.auth-links a {
    color: var(--text-muted);
}

.auth-links a:hover {
    color: var(--accent-gold);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    z-index: 3000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none;
}

.toast.show {
    display: block;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: #7f1d1d;
    border-color: #ef4444;
}

.toast.success {
    background: #064e3b;
    border-color: #10b981;
}

/* Mobile Menu Adjustments */
@media (max-width: 768px) {
    .nav-links .nav-btn {
        width: 80%;
        margin: 0.5rem 0;
    }
}