/* ===== Variables ===== */
:root {
    --primary-dark: #0a0e17;
    --secondary-dark: #1a1f2e;
    --accent-gold: #ffd700;
    --accent-gold-light: #ffed4e;
    --accent-blue: #4a6fa5;
    --text-light: #f0f4f8;
    --text-gray: #a0aec0;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --chess-white: #f0d9b5;
    --chess-black: #b58863;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(255, 215, 0, 0.5);
}



/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Poppins', sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-light);
    overflow-x: hidden;
    /* cursor: url('data:image/svg+xml;utf8,<svg width="32px" height="32px" viewBox="-64 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="%23ffd700" d="M19 272.47l40.63 18.06a32 32 0 0 0 24.88.47l12.78-5.12a32 32 0 0 0 18.76-20.5l9.22-30.65a24 24 0 0 1 12.55-15.65L159.94 208v50.33a48 48 0 0 1-26.53 42.94l-57.22 28.65A80 80 0 0 0 32 401.48V416h319.86V224c0-106-85.92-192-191.92-192H12A12 12 0 0 0 0 44a16.9 16.9 0 0 0 1.79 7.58L16 80l-9 9a24 24 0 0 0-7 17v137.21a32 32 0 0 0 19 29.26zM52 128a20 20 0 1 1-20 20 20 20 0 0 1 20-20zm316 320H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h352a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"/></svg>') 16 16, auto; */
    cursor: url('data:image/svg+xml;utf8, <svg width="32px" height="32px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23ffd700" d="M3 3L10 22L12.0513 15.8461C12.6485 14.0544 14.0544 12.6485 15.846 12.0513L22 10L3 3Z" /></svg>') 16 16, auto;

    /* Arrow cursor icon
    cursor: url('data:image/svg+xml;utf8, <svg width="32px" height="32px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="%23ffd700" d="M3 3L10 22L12.0513 15.8461C12.6485 14.0544 14.0544 12.6485 15.846 12.0513L22 10L3 3Z" stroke="#000000" stroke-width="2" stroke-linejoin="round"/></svg>') 16 16, auto;

    */
}

.gradient-text {
    /* Create the gradient */
    background-image: linear-gradient(to right, var(--text-light), var(--accent-gold));
    /* Clip the background to the text (crucial step) */
    -webkit-background-clip: text;
    background-clip: text;
    /* Make the text color transparent to show the gradient */
    color: transparent;
}
/* ===== Chess Board Background ===== */
.chess-board-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(181, 136, 99, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(181, 136, 99, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(181, 136, 99, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(181, 136, 99, 0.05) 75%);
    background-size: 80px 80px;
    background-position: 0 0, 0 40px, 40px -40px, -40px 0;
    z-index: -1;
    animation: boardMove 30s linear infinite;
}



@keyframes boardMove {
    0% { background-position: 0 0, 0 40px, 40px -40px, -40px 0; }
    100% { background-position: 80px 80px, 80px 120px, 120px 40px, 40px 80px; }
}

/* ===== Floating Chess Pieces ===== */
.floating-pieces {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.piece {
    position: absolute;
    font-size: 3rem;
    color: rgba(255, 215, 0, 0.2);
    animation: float 20s infinite linear;
}

.pawn1 { top: 10%; left: 15%; animation-delay: 0s; }
.pawn2 { top: 20%; right: 20%; animation-delay: 5s; }
.rook { top: 60%; left: 10%; animation-delay: 10s; }
.bishop { bottom: 20%; right: 15%; animation-delay: 15s; }
.queen { top: 40%; right: 30%; animation-delay: 20s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(0) rotate(180deg); }
    75% { transform: translateY(20px) rotate(270deg); }
}

/* ===== Knight Logo Animation ===== */
.knight-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    z-index: -1;
    opacity: 0.1;
}

.chess-piece.knight {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: var(--accent-gold);
    animation: knightPulse 3s infinite;
}

@keyframes knightPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
}

.move-indicators {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.move-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0;
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* ===== Sound Controls ===== */
.sound-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.sound-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(26, 31, 46, 0.8);
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.sound-btn:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: var(--glow);
}

/* ===== Navigation ===== */
.navbar {
    background: rgba(10, 14, 23, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding: 15px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chess-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-dark);
    box-shadow: var(--glow);
}

.brand-text h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--accent-gold), var(--accent-gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.brand-text span {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.navbar-toggler {
    border: none;
    background: transparent;
    color: var(--accent-gold);
    font-size: 1.5rem;
}

.nav-link {
    color: var(--text-light) !important;
    margin: 0 10px;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: var(--transition);
}

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

.nav-cta-btn {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
    margin-left: 20px;
}

.nav-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow);
}

/* ===== Registration Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    /* allow the overlay to scroll when modal is taller than the viewport */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    padding: 30px;
}

.modal-overlay.active {
    display: flex;
}

.registration-modal {
    max-width: 820px;
    width: 100%;
    background: linear-gradient(180deg, rgba(12,16,22,0.98), rgba(22,28,42,0.99));
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 30px 80px rgba(2,6,23,0.75);
    border: 1px solid rgba(255,215,0,0.06);

    /* keep modal content within the viewport and allow vertical scrolling */
    /* max-height: calc(100vh - 60px); */
    overflow-y: auto;
}

.registration-modal input,
.registration-modal textarea,
.registration-modal select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    color: var(--text-light);
}

/* Ensure select and options are readable on dark theme */
.registration-modal select {
    background: linear-gradient(180deg, #0a0e17, #111421);
    color: var(--text-light);
    -webkit-appearance: none;
    appearance: none;
}
.registration-modal select option {
    background: #0a0e17;
    color: var(--text-light);
}

.modal-close {
    position: absolute;
    right: 18px;
    top: 12px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
}

.modal-actions { display:flex; gap:12px; margin-top:6px; }
.registration-success { color: var(--success); font-weight:700; }

/* Send-method buttons in registration modal */
.send-methods { margin: 8px 0 0; display:flex; flex-direction:column; gap:8px; }
.send-method-label { color: var(--text-gray); font-size: 0.95rem; margin-bottom:4px; }
.send-method-buttons { display:flex; gap:8px; }
.method-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
}
.method-btn.active {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
    border-color: rgba(255,215,0,0.2);
}

/* Video modal */
.video-modal .modal-body { padding: 0; display:flex; align-items:center; justify-content:center; }
.video-modal .modal-content { max-width: 920px; width: 100%; position: relative; }
.video-modal .video-player {
    display: block;
    /* margin: 0 auto; */
    width: 100%;
    max-width: 880px;
    height: auto;
    max-height: 70vh;
    border-radius: 10px;
    background: black;
    object-fit: contain;
}
.video-modal .modal-header {
    display:block;
    text-align:center;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    position: relative;
}
.video-modal .modal-close { position: absolute; left: 14px; top: 10px; right: auto; }
.modal-title { font-size: 1.25rem; text-align: center; font-weight: 700; color: var(--text-light); }
.modal-subtitle { font-size: 0.95rem; color: var(--text-gray); display:block; margin-top:6px; }
.modal-body { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.03); display:flex; justify-content:flex-end; gap:10px; }

.registration-form-modal .send-methods{
    display:none;
    margin:8px 0 0;
}

@media (max-width: 768px) {
    .registration-modal { padding: 14px; }
    .modal-title { font-size: 1.05rem; } 
    .registration-form-modal .send-methods { display: flex; }
    .registration-form-modal .send-method-buttons { flex-wrap: wrap; }
}

/* ===== Hero Section ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    overflow: hidden;
}

.badge-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.badge {
    background: linear-gradient(135deg, var(--accent-blue), #6b8cce);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: badgePulse 2s infinite;
}

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

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 25px;
}

.highlight {
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
    border-radius: 2px;
}

.lead {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 40px;
    max-width: 600px;
}

.cta-container {
    display: flex;
    gap: 20px;
    margin-bottom: 50px;
}

.cta-btn {
    padding: 15px 35px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.cta-btn.primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
}

.cta-btn.secondary {
    background: transparent;
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
}

.cta-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow);
}

.stats-container {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.stat h3 {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 5px;
}

.stat p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* ===== Hero Visual ===== */

.hero-visual {
    position: relative;
}

.chess-board-animation {
    position: relative;
    width: 100%;
    height: 500px;
    background: rgba(26, 31, 46, 0.5);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    height: 100%;
    position: relative;
}

.board-square {
    position: relative;
}

.board-square.white {
    background-color: var(--chess-white);
}

.board-square.black {
    background-color: var(--chess-black);
}

.moving-pieces {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.piece-move {
    position: absolute;
    font-size: 2.5rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.7));
}

.animate-1 {
    animation: knightMove 8s infinite;
}

.animate-2 {
    animation: queenMove 10s infinite;
}

@keyframes knightMove {
    0% { top: 10%; left: 10%; transform: rotate(0deg); }
    25% { top: 10%; left: 70%; transform: rotate(90deg); }
    50% { top: 70%; left: 70%; transform: rotate(180deg); }
    75% { top: 70%; left: 10%; transform: rotate(270deg); }
    100% { top: 10%; left: 10%; transform: rotate(360deg); }
}

@keyframes queenMove {
    0% { top: 50%; left: 50%; transform: translate(-50%, -50%); }
    33% { top: 20%; left: 20%; transform: translate(-50%, -50%) scale(1.2); }
    66% { top: 80%; left: 80%; transform: translate(-50%, -50%) scale(0.8); }
    100% { top: 50%; left: 50%; transform: translate(-50%, -50%); }
}

.trainer-card {
    position: absolute;
    bottom: -50px;
    right: -30px;
    width: 300px;
    transform: rotate(5deg);
}

.card-content {
    background: linear-gradient(135deg, var(--secondary-dark), #2a3147);
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid var(--accent-gold);
    box-shadow: var(--shadow);
}

.trainer-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-overlay {
    padding: 20px;
    text-align: center;
}

.rating {
    color: var(--accent-gold);
    margin-top: 10px;
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    position: relative;
    margin: 0 auto;
}

.wheel {
    width: 4px;
    height: 10px;
    background: var(--accent-gold);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { top: 10px; opacity: 1; }
    100% { top: 30px; opacity: 0; }
}

.arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.arrows span {
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
    transform: rotate(45deg);
    margin: -5px;
    animation: arrowMove 2s infinite;
}

.arrows span:nth-child(2) { animation-delay: 0.2s; }
.arrows span:nth-child(3) { animation-delay: 0.4s; }

@keyframes arrowMove {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== Section Styling ===== */
.section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.5rem;
    box-shadow: var(--glow);
}

.section-subtitle {
    color: var(--text-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Feature Cards ===== */
.feature-card {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(42, 49, 71, 0.8));
    border-radius: 15px;
    padding: 40px 30px;
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.1);
    transition: var(--transition);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.card-hover:hover {
    transform: translateY(-10px);
    border-color: var(--accent-gold);
    box-shadow: var(--glow);
}

.card-hover:hover .icon-circle {
    transform: scale(1.1) rotate(10deg);
    box-shadow: var(--glow);
}

.card-icon {
    margin-bottom: 25px;
}

.icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-dark);
    transition: var(--transition);
}

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

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

.feature-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent-gold);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ===== Trainer Section ===== */
.trainer-profile {
    position: relative;
}

.profile-frame {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 5px solid var(--accent-gold);
}

.profile-img {
    width: 100%;
    height: 500px;
}

.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--glow);
}

.achievement-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.achievement {
    background: rgba(255, 215, 0, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.achievement i {
    color: var(--accent-gold);
    font-size: 1.5rem;
}

.timeline {
    margin: 40px 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    right: 20px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-gold), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-right: 50px;
}

.timeline-dot {
    position: absolute;
    top: 5px;
    right: 15px;
    width: 15px;
    height: 15px;
    background: var(--accent-gold);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-gold);
}

.skills {
    margin-top: 40px;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-light);
}

.skill-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* ===== Training Process ===== */
.training-process {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 auto 70px;
}

.process-step {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(42, 49, 71, 0.8));
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid var(--accent-gold);
    transition: var(--transition);
    margin:  20px;
}

.process-step:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin-left: 30px;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.step-icon {
    font-size: 2.5rem;
    color: var(--accent-gold);
    opacity: 0.7;
}

.platform-showcase {
    text-align: center;
}

.platforms {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.platform-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-blue), #6b8cce);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    transition: var(--transition);
}

.platform:hover .platform-icon {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 20px rgba(74, 111, 165, 0.7);
}

/* ===== Chess Demo ===== */

.chess-demo {
    background: rgba(10, 14, 23, 0.8);
    padding: 5px 0;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.demo-header {
    text-align: center;
    margin-bottom: 50px;
}

.demo-board {
    background: rgba(26, 31, 46, 0.9);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid var(--accent-gold);
    max-width: 900px;
    height: auto; ;
    margin: 0 auto;
}
.chess {
    height: 400px;
    aspect-ratio: 6/5;
    width: 100%;
}
.demo-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.control-btn {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow);
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 600px;
    height: 600px;
    margin: 0 auto;
    border: 3px solid var(--accent-gold);
}

.demo-square {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-square.white {
    background-color: var(--chess-white);
}

.demo-square.black {
    background-color: var(--chess-black);
}

.demo-square.highlight {
    background-color: rgba(255, 215, 0, 0.5) !important;
}

.demo-piece {
    font-size: 2.5rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

/* ===== Footer ===== */
footer {
    background: linear-gradient(to bottom, rgba(10, 14, 23, 0.95), rgba(26, 31, 46, 0.95));
    padding: 80px 0 30px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-logo i {
    font-size: 3rem;
    color: var(--accent-gold);
}

.footer-logo h3 {
    font-size: 2rem;
    background: linear-gradient(to right, var(--accent-gold), var(--accent-gold-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-desc {
    color: var(--text-gray);
    margin-top: 20px;
    line-height: 1.8;
}

.footer-links h5 {
    color: var(--accent-gold);
    margin-bottom: 25px;
    font-size: 1.3rem;
}

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

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links a:hover {
    color: var(--accent-gold);
    transform: translateX(5px);
}

.footer-cta {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 237, 78, 0.1));
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.footer-cta h5 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.footer-cta p {
    color: var(--text-gray);
    margin-bottom: 25px;
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.social-links a:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
    transform: translateY(-5px);
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .trainer-card {
        position: relative;
        margin-top: 50px;
        right: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 150px;
    }
    
    .cta-container {
        flex-direction: column;
    }
    
    .section-title {
        flex-direction: column;
        gap: 10px;
    }
    
    .process-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-left: 0;
        margin-bottom: 20px;
    }
    
    .step-icon {
        margin-top: 20px;
    }
    
    .demo-grid {
        width: 90vw;
        height: 90vw;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* ===== Game-like Animations ===== */
@keyframes glowPulse {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9)); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeInUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== Custom Cursor Effects ===== */
.interactive {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="%23ffd700" d="M16 2L2 16l4 4 10-10 10 10 4-4L16 2z"/></svg>') 16 16, pointer;

}

.game-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="%23ffd700" d="M28 16c0 6.627-5.373 12-12 12S4 22.627 4 16 9.373 4 16 4s12 5.373 12 12zm-12-7l-5 5h3v6h4v-6h3l-5-5z"/></svg>') 16 16, pointer;
}

/* ===== Particle Effects ===== */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-gold);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}


/* ===== تنسيق شريط التمرير ===== */

/* المتصفحات التي تدعم Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--primary-dark);
    border-left: 1px solid rgba(255, 215, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    border-radius: 6px;
    border: 3px solid var(--primary-dark);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
    transform: scale(1.05);
}

::-webkit-scrollbar-corner {
    background: var(--primary-dark);
}

/* شريط التمرير الأفقي */
::-webkit-scrollbar:horizontal {
    height: 12px;
}

::-webkit-scrollbar-thumb:horizontal {
    min-width: 40px;
}

/* تنسيق خاص لعناصر محددة */
.container, .feature-card, .training-card {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) var(--primary-dark);
}

/* متصفح Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) var(--primary-dark);
}

/* تنسيق متقدم مع تأثيرات */
::-webkit-scrollbar-track-piece {
    background: linear-gradient(to bottom, 
        rgba(10, 14, 23, 0.8), 
        rgba(26, 31, 46, 0.8)
    );
    border-radius: 6px;
}

::-webkit-scrollbar-button {
    display: none;
}

/* شريط التمرير مع نمط رقعة الشطرنج */
.scrollbar-chess {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) transparent;
}

.scrollbar-chess::-webkit-scrollbar-track {
    background-image: 
        linear-gradient(45deg, rgba(181, 136, 99, 0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(181, 136, 99, 0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(181, 136, 99, 0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(181, 136, 99, 0.1) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

/* تأثيرات عند التمرير */
body {
    scroll-behavior: smooth;
}

/* تنسيق شريط التمرير للشيفرات */
pre, code {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) var(--secondary-dark);
}

pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

pre::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

/* تنسيق للموبايل */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    ::-webkit-scrollbar-thumb {
        border-width: 2px;
    }
}

/* تأثيرات متحركة */
@keyframes scrollbarGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.6); }
}

::-webkit-scrollbar-thumb:active {
    animation: scrollbarGlow 1.5s infinite;
}

/* تنسيق خاص لمناطق معينة */
.modal-content, .dropdown-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.7) rgba(10, 14, 23, 0.9);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.7);
    border-radius: 3px;
}

/* ===== Certifications Section ===== */
.certification-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    background: rgba(255, 215, 0, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
    border-color: var(--accent-gold);
    box-shadow: var(--glow);
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 أعمدة فقط */
    gap: 20px;
}

.certification-card {
    display: grid;
    grid-template-columns: 50% 1fr ;
    min-height: 270px;
    border-radius: 12px;
    background: linear-gradient(135deg, 
        rgba(26, 31, 46, 0.95), 
        rgba(42, 49, 71, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.certification-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 215, 0, 0.03) 50%, 
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.certification-card:hover::before {
    opacity: 1;
}

/* خيار: تصميم أفقي للبطاقات */
.certification-card.horizontal {
    display: grid;
    grid-template-columns: 150px 1fr;
    grid-template-rows: 1fr auto;
    gap: 0;
}

.certification-card.horizontal .certificate-header {
    height: 100%;
    grid-row: 1 / span 2;
}

.certification-card.horizontal .certificate-body {
    grid-column: 2;
    padding: 20px;
}


.certification-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-gold);
    box-shadow: var(--glow);
}

@media (min-width: 1025px) {
    .certification-card.elegant {
        position: relative;
        overflow: visible;
    }
    
    .certification-card.elegant:hover {
        transform: translateY(-10px) scale(1.02);
    }
    
    .certification-card.elegant::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, 
            rgba(255, 215, 0, 0) 0%, 
            rgba(255, 215, 0, 0.1) 100%);
        z-index: -1;
        border-radius: 15px;
        transform: scale(0.95);
        transition: var(--transition);
        opacity: 0;
    }
    
    .certification-card.elegant:hover::after {
        opacity: 1;
        transform: scale(1.05);
    }
}

.certificate-header {
    position: relative;
    overflow: hidden;
}

.certificate-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.certification-card:hover .certificate-image {
    transform: scale(1.1);
}

.certificate-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    top: auto;
    background: var(--accent-gold);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 10px;
}

.certificate-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.certificate-body h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    height: 36px;
    color: var(--accent-gold);
}

.certificate-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 10px;
}

.meta-item {
    font-size: 0.8rem;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.meta-item i {
    color: var(--accent-gold);
    font-size: 0.9rem;
}

.certificate-description {
    font-size: 0.85rem;
    line-height: 1.4;
    height: 40px;
}


.view-cert-btn {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    width: 100%;
    justify-content: center;
    margin-bottom: 15px;
}

.view-cert-btn:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

.certificate-id {
    font-size: 0.55rem;
    color: var(--text-gray);
    direction: ltr;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 8px;
    text-align: center;
    word-break: break-all;
}

/* Loading Spinner */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
}

.spinner {
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
}

.spinner i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Certificate Modal */
.certificate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    animation: modalFadeIn 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    width: 90%;
    max-width: 1000px;
    margin: 50px auto;
    border-radius: 20px;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--accent-gold);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 500px;
}

.modal-image {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-details {
    padding: 40px;
    overflow-y: auto;
    max-height: 500px;
}

.modal-details h3 {
    color: var(--accent-gold);
    font-size: 1.8rem;
    margin-bottom: 25px;
    line-height: 1.3;
}

.modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.modal-meta .meta-item {
    background: rgba(255, 215, 0, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.modal-meta .meta-item i {
    font-size: 1.2rem;
}

.modal-details p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-btn {
    flex: 1;
    padding: 15px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
}

.modal-btn.secondary {
    background: transparent;
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
}

.modal-btn.secondary:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

/* Certificate Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* .certification-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    
} */
@media (max-width: 1024px) {
    .certifications-grid {
        grid-template-columns: 1fr;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .certification-card {
        grid-template-columns: 50% 1fr;
    }
}
/* Responsive Design for Certifications */
@media (max-width: 992px) {
    .certifications-grid {
        grid-template-columns: 1fr;
    }
    .certification-card {
        grid-template-columns: 50% 1fr; /* صورة أصغر للموبايل */
        max-height: 200px;
    }
    
    .certificate-body h3 {
        font-size: 1.1rem;
        height: 35px;
    }
    
    .certificate-description {
        height: 40px;
    }
}


@media (max-width: 768px) {

    .certifications-grid {
        grid-template-columns: 1fr;
    }
    
    .certificate-body {
        padding: 15px;
    }
    
    .certificate-meta {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .certificate-body h3 {
        font-size: 1rem;
        height: 32px;
    }
}

@media (max-width: 480px) {

    .certifications-grid {
        grid-template-columns: 1fr;
    }
    .certification-card {
        grid-template-columns: 40% 1fr;
        min-height: 140px;
    }
    
    .certificate-body {
        padding: 12px;
    }
    
    .certificate-badge {
        font-size: 0.6rem;
        padding: 3px 8px;
    }
}


/* ===== Photo Gallery Section ===== */
.gallery-container {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8), rgba(42, 49, 71, 0.8));
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    background: rgba(255, 215, 0, 0.1);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.gallery-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    border: none;
    color: var(--primary-dark);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.gallery-info {
    font-size: 1.3rem;
    color: var(--accent-gold);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 25px;
    border-radius: 25px;
    min-width: 100px;
    text-align: center;
}

/* Main Image Display */
.gallery-main {
    position: relative;
    margin-bottom: 30px;
}


#mainGalleryImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}



.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 30px;
    color: white;
    transform: translateY(0);
    transition: transform 0.3s ease;
}



.image-overlay h3 {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.image-overlay p {
    color: var(--text-light);
    font-size: 1rem;
    opacity: 0.9;
}

.autoplay-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.autoplay-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: var(--primary-dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.autoplay-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.autoplay-controls span {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Thumbnails Grid */
.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

.thumbnail-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail-item.active {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
}

.thumbnail-item:hover:not(.active) {
    border-color: rgba(255, 215, 0, 0.5);
    transform: scale(1.03);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail-item:hover img {
    transform: scale(1.1);
}

.thumbnail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px;
    text-align: center;
    font-size: 0.8rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail-item:hover .thumbnail-overlay {
    opacity: 1;
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.gallery-filters .filter-btn {
    background: rgba(255, 215, 0, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
}

.gallery-filters .filter-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.gallery-filters .filter-btn.active {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--primary-dark);
    border-color: var(--accent-gold);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {

    .gallery-thumbnails {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-controls {
        gap: 15px;
    }
    
    .gallery-btn {
        width: 40px;
        height: 40px;
    }
    
    
    .image-overlay {
        padding: 20px;
    }
    
    .image-overlay h3 {
        font-size: 1.2rem;
    }
    
    .gallery-thumbnails {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
}

@media (max-width: 576px) {

    
    .gallery-filters {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
    }
    
    .gallery-filters::-webkit-scrollbar {
        height: 4px;
    }
    
    .gallery-filters::-webkit-scrollbar-thumb {
        background: var(--accent-gold);
    }
}

/* Loading Animation */
.gallery-loading {
    text-align: center;
    padding: 50px;
}

.gallery-loading .spinner {
    font-size: 3rem;
    color: var(--accent-gold);
    animation: spin 2s linear infinite;
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-gallery-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Animation for image transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes slideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in {
    animation: slideIn 0.5s ease;
}


/* ===== Gallery with Video Support ===== */
.media-type-badge {
    background: linear-gradient(135deg, #4a6fa5, #6b8cce);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 10px;
    font-weight: 500;
}

/* Main Media Container */
.main-media-container {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.main-media-container:hover .image-overlay {
    transform: translateY(-5px);
}
/* Image Container */
.image-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.image-container.active {
    opacity: 1;
    pointer-events: auto;
}

/* #mainGalleryImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
} */

/* Video Container */
.video-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    background: #000;
}

.video-container.active {
    opacity: 1;
    pointer-events: auto;
}

.video-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#mainGalleryVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px;
    color: white;
    z-index: 10;
}

.video-overlay h3 {
    color: var(--accent-gold);
    margin-bottom: 5px;
}

/* Custom Video Controls */
.video-controls-custom {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 20;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.video-btn {
    background: transparent;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.video-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.video-progress {
    flex: 1;
    height: 5px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.video-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: var(--accent-gold);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider {
    width: 80px;
    height: 5px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-gold);
    border-radius: 50%;
    cursor: pointer;
}

/* Media Overlay */
.media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 30px;
    color: white;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.image-container:hover .media-overlay {
    transform: translateY(-5px);
}

/* Video Icon in Thumbnails */
.video-thumbnail {
    position: relative;
}

.video-thumbnail::after {
    content: '\f144';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* Progress Bar for Autoplay */
.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
    width: 100%;
    transform-origin: left;
}

/* Responsive Design for Video */
@media (max-width: 992px) {
    .main-media-container {
        height: 400px;
    }
    
    .video-controls-custom {
        padding: 8px 15px;
        gap: 10px;
    }
    
    .video-btn {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 768px) {
    .main-media-container {
        height: 300px;
    }
    
    .video-controls-custom {
        padding: 5px 10px;
        gap: 8px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .media-overlay {
        padding: 15px;
    }
    
    .media-overlay h3 {
        font-size: 1.1rem;
    }
}

/* Video Fullscreen */
.video-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.video-fullscreen .video-wrapper {
    flex: 1;
}

.video-fullscreen .video-controls-custom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}


.video-thumbnail {
    position: relative;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
    border-radius: 8px;
}

.video-thumbnail .thumbnail-overlay i {
    margin-left: 5px;
    color: var(--accent-gold);
}

/* مؤشر المدة */
.video-duration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

/* مؤشر الصورة التلقائية */
.auto-thumbnail-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 215, 0, 0.9);
    color: var(--primary-dark);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    z-index: 2;
}

/* مؤشر التحميل للصور المصغرة */
.thumbnail-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-gold);
    font-size: 1.5rem;
    z-index: 3;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* تحسين مظهر الصور المصغرة */
.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 0;
}

.thumbnail-item:hover img {
    transform: scale(1.05);
}

/* ===== Mobile / Reduced Motion Optimizations ===== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 768px), (pointer: coarse) {
    /* Hide heavy decorative elements on small/touch screens */
    .floating-pieces,
    .knight-logo,
    .move-indicators,
    .chess-board-bg {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Simplify navbar and controls */
    .navbar {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        border-bottom: 0 !important;
        padding: 10px 0 !important;
    }

    .sound-controls { bottom: 16px; right: 16px; }
    .sound-btn { width: 44px; height: 44px; font-size: 1rem; }

    /* Remove heavy drop-shadows & glows for performance */
    .brand-logo .chess-icon,
    .nav-cta-btn,
    .chess-piece.knight,
    .thumbnail-item img {
        box-shadow: none !important;
        filter: none !important;
    }

    /* Disable custom cursor on touch devices */
    body { cursor: auto !important; }

    /* Make hero content stack and fit better */
    .hero-section .hero-visual { display: none; }
    .hero-section .hero-content { width: 100%; }

    /* Reduce modal sizes to fit viewport */
    .registration-modal,
    .video-modal .modal-content { 
        max-width: 95% !important;
        padding: 12px !important;
        font-size: small;
    }
    .cta-btn{
        font-size: 0.7rem;
    }
}

/* Further reduce animation on small screens */
@media (max-width: 480px) {
    .badge-container { display: none; }
    .stats-container { justify-content: center !important; }
    .scroll-indicator {display: none;}
    .gallery-container { padding: 7px !important;  }
}

/* ===== Mobile fixes & overrides (added) ===== */

/* Prevent any unexpected horizontal scrolling */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
}

/* Hero: make CTA buttons equal width and stack nicely on small screens */
.cta-container .cta-btn {
    min-width: 160px;
}
@media (max-width: 768px) {
    .cta-container .cta-btn { width: 100%; justify-content: center; }
}

/* Keep stats side-by-side on mobile, only stack on very small screens */
@media (max-width: 992px) {
    .stats-container { flex-direction: row !important; gap: 18px; justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 420px) {
    .stats-container { flex-direction: column; }
}

/* Reduce modal margins/padding on small screens so they appear full-bleed */
@media (max-width: 768px) {
    .modal-overlay { padding: 12px; align-items: center; }
    .modal-content { margin: 12px auto !important; max-width: 95% !important; }
}

/* Normalize and center modal close button; remove extreme rotation on hover */
.modal-close {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    text-align: center;
}
.modal-close:hover { 
    transform: scale(1.05) !important;
     background: rgba(255,215,0,0.06) !important;
}

/* Chess demo: make the board take more width on mobile */
@media (max-width: 992px) {
    .demo-board { max-width: 100% !important; padding: 12px !important; }
    .chess { aspect-ratio: 3/4!important; width: 100%; }
}
@media (max-width: 480px) {
    .modal-close { width: 40px !important; height: 40px !important; font-size: 1.05rem !important; }
    .modal-close:hover { transform: none !important; }
    .video-overlay { padding: 12px !important; }
    .video-overlay h3 { font-size: 0.8rem !important; }
    .video-overlay p { font-size: 0.6rem !important; }

    .media-overlay { padding: 12px !important; }
    .media-overlay h3 { font-size: 0.9rem !important; }
    .media-overlay p { font-size: 0.7rem !important; }

    .thumbnail-overlay { font-size: 0.6rem !important;}
    .chess { aspect-ratio: 1 !important; width: 100%;}   
}


/* Certificate modal: show the certificate image only and simplify layout */
.certificate-modal .modal-content { max-width: 98% !important; margin: 8px auto !important; }
.certificate-modal .modal-body { display: flex !important; justify-content: center; align-items: center; padding: 8px !important; grid-template-columns: 1fr !important; min-height: 60vh; }
.certificate-modal .modal-details { display: none !important; }
.certificate-modal .modal-image { width: 100%; padding: 6px !important; }
.certificate-modal .modal-image img { width: 100%; height: auto; border-radius: 8px; }

/* Certification filter buttons smaller on narrow screens */
@media (max-width: 576px) {
    .filter-btn, .gallery-filters .filter-btn { padding: 8px 12px; font-size: 0.85rem; }
}

/* Gallery: hide bulky labels/controls on small screens */
@media (max-width: 768px) {
    .autoplay-controls { padding: 10px 10px;top: 10px;left: 10px; }
    #autoplayText, #autoplayProgress { display: none !important; }
    .gallery-btn { width: 36px; height: 36px; font-size: 0.95rem; }
}

/* Training: stack process steps vertically on small screens */
@media (max-width: 768px) {
    .training-process { grid-template-columns: 1fr !important; margin: 0 auto 30px; }
    .process-step { margin: 12px !important; }
}



/* Ensure images and iframes never overflow */
img, iframe, video { max-width: 100%; height: auto; }
