/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Purple Theme Colors */
    --primary-purple: #8B5CF6;
    --secondary-purple: #A78BFA;
    --dark-purple: #6D28D9;
    --light-purple: #C4B5FD;
    --purple-glow: rgba(139, 92, 246, 0.4);
    
    /* Glass Effect Colors */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: rgba(139, 92, 246, 0.3);
    
    /* Typography */
    --font-arabic: 'Cairo', sans-serif;
    --font-english: 'Inter', sans-serif;
}

body {
    font-family: var(--font-arabic);
    min-height: 100vh;
    position: relative;
    background: #1a1a2e;
    padding-bottom: 50px;
}

/* Background Container */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #1a1a2e 0%, 
        #16213e 25%, 
        #0f3460 50%, 
        #533483 75%, 
        #8B5CF6 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glass Orbs for Liquid Effect */
.glass-orb {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(139, 92, 246, 0.2) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: -75px;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(15px) rotate(240deg); }
}

/* Main Container */
.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/* Glass Card - Apple Liquid Glass Style */
.glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 
        0 8px 32px rgba(139, 92, 246, 0.2),
        0 2px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 40px rgba(139, 92, 246, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Logo */
.logo-container {
    margin-bottom: 35px;
}

.logo {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(139, 92, 246, 0.4));
    transition: transform 0.3s ease;
}

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

/* Typography */
.title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 14px;
    text-shadow: 0 2px 10px rgba(139, 92, 246, 0.5);
    line-height: 1.2;
}

.subtitle {
    font-size: 1.05rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    line-height: 1.5;
}

.subtitle-en {
    font-family: var(--font-english);
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 35px;
    line-height: 1.4;
}

/* Enter Button */
.button-container {
    position: relative;
}

.enter-btn {
    background: linear-gradient(135deg, 
        var(--primary-purple) 0%, 
        var(--secondary-purple) 100%);
    border: none;
    border-radius: 16px;
    padding: 18px 36px;
    font-family: var(--font-arabic);
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 20px rgba(139, 92, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    min-width: 200px;
}

.enter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.enter-btn:hover::before {
    left: 100%;
}

.enter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(139, 92, 246, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.enter-btn:active {
    transform: translateY(0);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.enter-btn:hover .btn-glow {
    width: 100px;
    height: 100px;
}

/* Theme Transition Circle */
.theme-transition-circle {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(135deg,
        #f8fafc 0%,
        #e2e8f0 25%,
        #cbd5e1 50%,
        #94a3b8 75%,
        #64748b 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-transition-circle.active {
    width: 300vmax;
    height: 300vmax;
    opacity: 1;
}

/* Light Theme Styles */
body.light-theme {
    background: #faf7ff;
}

body.light-theme .gradient-bg {
    background: linear-gradient(135deg,
        #faf7ff 0%,
        #f3f0ff 20%,
        #ede9fe 40%,
        #ddd6fe 60%,
        #c4b5fd 80%,
        #a855f7 100%);
}

body.light-theme .glass-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(139, 92, 246, 0.1),
        0 2px 16px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.light-theme .glass-orb {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(139, 92, 246, 0.1) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.light-theme .title {
    color: #1e293b;
    text-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

body.light-theme .subtitle {
    color: rgba(30, 41, 59, 0.8);
}

body.light-theme .subtitle-en {
    color: rgba(30, 41, 59, 0.6);
}

body.light-theme .enter-btn {
    background: linear-gradient(135deg,
        #8b5cf6 0%,
        #a855f7 100%);
    box-shadow:
        0 4px 20px rgba(139, 92, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.light-theme .enter-btn:hover {
    box-shadow:
        0 6px 25px rgba(139, 92, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Loading State Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        #faf7ff 0%,
        #f3f0ff 20%,
        #ede9fe 40%,
        #ddd6fe 60%,
        #c4b5fd 80%,
        #a855f7 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: #4c1d95;
}

.loading-title {
    font-family: var(--font-arabic);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.loading-subtitle {
    font-family: var(--font-arabic);
    font-size: 1.2rem;
    font-weight: 400;
    color: #6b21a8;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite, fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

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

/* BAHY FILMS Links Section - UNDER the main square */
.bahy-links-container {
    display: flex;
    justify-content: center;
    margin-top: 5px;
    padding: 0 20px;
    width: 100%;
}

.bahy-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    max-width: 100%;
}

.bahy-link {
    display: inline-block;
    font-family: var(--font-english);
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bahy-link:hover {
    color: #ffffff;
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.bahy-link:active {
    transform: translateY(0);
}

/* Light Theme Styles for BAHY Links */
body.light-theme .bahy-links-container {
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

body.light-theme .bahy-link {
    color: rgba(30, 41, 59, 0.7);
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

body.light-theme .bahy-link:hover {
    color: #1e293b;
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}
