/* Base Template - Site Styles */

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

/* RTL Adjustments */
[dir="rtl"] .me-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

[dir="rtl"] .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .me-3 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

[dir="rtl"] .ms-1 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

[dir="rtl"] .ms-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

[dir="rtl"] .ms-3 {
    margin-left: 0 !important;
    margin-right: 1rem !important;
}

/* RTL: Flip arrow icons used as Back buttons */
[dir="rtl"] .bi-arrow-left::before {
    content: "\f12f"; /* bi-arrow-right */
}

[dir="rtl"] .bi-arrow-right::before {
    content: "\f121"; /* bi-arrow-left */
}

/* Form validation */
.field-validation-error {
    color: #dc3545;
    font-size: 0.875rem;
}

.input-validation-error {
    border-color: #dc3545;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Card hover effect */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
    }

/* ===== Landing Page Styles ===== */

/* --- Color Palette ---
   Primary dark:   #0B121F (deep charcoal)
   Surface dark:   #111a2b (slightly lighter)
   Surface card:   #162033 (card backgrounds)
   Accent gold:    #e8b645 (warm amber gold)
   Accent green:   #10b981 (emerald)
   Text primary:   #f1f5f9
   Text secondary: #94a3b8
*/

/* Hero Section */
.landing-hero {
    background: #0B121F;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(16, 185, 129, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(232, 182, 69, 0.08) 0%, transparent 50%);
    color: #f1f5f9;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: "♔♕♖♗♘♙♚♛♜♝♞♟";
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8rem;
    opacity: 0.025;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 1.5rem;
    color: #fff;
}

.landing-hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.landing-hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #e8b645 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero-subtitle {
    font-size: 1.15rem;
    color: #94a3b8;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

.landing-gold {
    color: #e8b645;
}

.landing-btn-gold {
    background: linear-gradient(135deg, #e8b645 0%, #d4a33a 100%);
    border: none;
    color: #0B121F;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 0.625rem;
    box-shadow: 0 4px 15px rgba(232, 182, 69, 0.3);
    transition: all 0.3s ease;
}

.landing-btn-gold:hover {
    background: linear-gradient(135deg, #f0c050 0%, #e8b645 100%);
    color: #0B121F;
    box-shadow: 0 6px 25px rgba(232, 182, 69, 0.45);
    transform: translateY(-2px);
}

.landing-btn-outline {
    border: 2px solid rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
    padding: 0.7rem 2rem;
    border-radius: 0.625rem;
    transition: all 0.3s ease;
    background: transparent;
}

.landing-btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    transform: translateY(-2px);
}

/* Sections */
.landing-section {
    padding: 5rem 0;
}

.landing-section-dark {
    background: #0B121F;
    color: #f1f5f9;
}

.landing-section-alt {
    background: #0f1929;
    color: #f1f5f9;
}

.landing-section-title {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
}

.landing-section-subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.landing-section-dark .landing-section-subtitle,
.landing-section-alt .landing-section-subtitle {
    color: #94a3b8;
}

/* Feature Cards */
.landing-card {
    background: #162033;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 1rem;
    transition: all 0.35s ease;
    height: 100%;
    color: #f1f5f9;
}

.landing-card:hover {
    transform: translateY(-6px);
    border-color: rgba(232, 182, 69, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(232, 182, 69, 0.1) !important;
}

.landing-card h5 {
    color: #f1f5f9;
}

.landing-card p.text-muted {
    color: #94a3b8 !important;
}

.landing-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(232, 182, 69, 0.15));
    color: #e8b645;
    border: 1px solid rgba(232, 182, 69, 0.1);
}

/* Feature Lists */
.landing-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.landing-feature-list li {
    padding: 0.55rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: #cbd5e1;
}

.landing-feature-list li i {
    color: #10b981;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Feature Panels (Members / Admins) */
.landing-feature-panel {
    background: #162033;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 1rem;
    padding: 2.25rem;
    height: 100%;
    transition: border-color 0.3s ease;
    color: #f1f5f9;
}

.landing-feature-panel:hover {
    border-color: rgba(16, 185, 129, 0.2);
}

.landing-feature-panel small.text-muted {
    color: #94a3b8 !important;
}

.landing-feature-panel-admin {
    background: linear-gradient(135deg, #162033 0%, #1a1535 100%);
    border: 1px solid rgba(232, 182, 69, 0.12);
}

.landing-feature-panel-admin:hover {
    border-color: rgba(232, 182, 69, 0.3);
}

.landing-feature-panel-admin small {
    color: #94a3b8 !important;
}

/* How It Works - Steps */
.landing-step {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    transition: background 0.3s ease;
}

.landing-step:hover {
    background: rgba(255, 255, 255, 0.03);
}

.landing-step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8b645 0%, #d4a33a 100%);
    color: #0B121F;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(232, 182, 69, 0.25);
}

.landing-step-title {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.landing-step p.text-muted {
    color: #94a3b8 !important;
}

/* Tournament Format Cards */
.landing-format-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 1rem;
    color: #f1f5f9;
    transition: all 0.35s ease;
    height: 100%;
}

.landing-format-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(232, 182, 69, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25) !important;
}

.landing-format-card .landing-chess-piece {
    font-size: 3.5rem;
    line-height: 1;
    display: block;
    background: linear-gradient(135deg, #e8b645, #f0d080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-format-card p {
    color: #94a3b8;
}

/* Final CTA */
.landing-cta {
    background: #0B121F;
    background-image:
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(232, 182, 69, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 20% 0%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
    color: #f1f5f9;
    padding: 5rem 0;
    position: relative;
}

.landing-cta p {
    color: #94a3b8;
}

/* Decorative */
.landing-chess-decoration {
    font-size: 3rem;
    opacity: 0.06;
    position: absolute;
    color: #e8b645;
}

/* Divider line between sections */
.landing-section + .landing-section,
.landing-section-alt + .landing-section,
.landing-section + .landing-section-alt {
    border-top: 1px solid rgba(148, 163, 184, 0.06);
}

/* Responsive */
@media (max-width: 768px) {
    .landing-hero {
        padding: 3.5rem 0 3rem;
    }

    .landing-hero-title {
        font-size: 2rem;
    }

    .landing-hero-subtitle {
        font-size: 1rem;
    }

    .landing-section {
        padding: 3.5rem 0;
    }

    .landing-section-title {
        font-size: 1.6rem;
    }

    .landing-feature-panel {
        padding: 1.75rem;
    }
}

/* ===== Contact Page Styles ===== */

.contact-page {
    background: #0B121F;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(232, 182, 69, 0.06) 0%, transparent 50%);
    color: #f1f5f9;
    padding: 5rem 0;
    min-height: calc(100vh - 56px - 60px);
}

.contact-subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

.contact-form-card {
    background: #162033;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 1rem;
    padding: 2.5rem;
}

.contact-label {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.95rem;
}

.contact-input {
    background: #0f1929 !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    color: #f1f5f9 !important;
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    transition: border-color 0.2s ease;
}

.contact-input:focus {
    border-color: rgba(232, 182, 69, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(232, 182, 69, 0.1) !important;
    background: #0f1929 !important;
    color: #f1f5f9 !important;
}

.contact-input::placeholder {
    color: #4a5568 !important;
}

.contact-input option {
    background: #0f1929;
    color: #f1f5f9;
}

.captcha-question {
    background: linear-gradient(135deg, rgba(232, 182, 69, 0.15), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(232, 182, 69, 0.2);
    border-radius: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e8b645;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .contact-page {
        padding: 3rem 0;
    }

    .contact-form-card {
        padding: 1.75rem;
    }
}

/* ===== Auth Pages (Login, Register, etc.) ===== */

.auth-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
    background: #0B121F;
}

.auth-card {
    background: #162033;
    border: 1px solid rgba(232, 182, 69, 0.15);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #e8b645, #d4a43a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: #0B121F;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.auth-floating {
    margin-bottom: 1rem;
}

.auth-floating .form-floating > .form-control {
    background: #0f1929;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    border-radius: 0.5rem;
    padding-left: 2.75rem;
    height: calc(3.5rem + 2px);
}

.auth-floating .form-control {
    background: #0f1929;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    border-radius: 0.5rem;
    padding-left: 2.75rem;
    height: calc(3.5rem + 2px);
}

.auth-floating .form-control:focus {
    background: #0f1929;
    border-color: #e8b645;
    box-shadow: 0 0 0 0.2rem rgba(232, 182, 69, 0.15);
    color: #f1f5f9;
}

.auth-floating label {
    color: #94a3b8;
    padding-left: 2.75rem;
}

.auth-floating .form-control:focus ~ label,
.auth-floating .form-control:not(:placeholder-shown) ~ label {
    color: #e8b645;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 4;
    font-size: 1rem;
}

[dir="rtl"] .auth-input-icon {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .auth-floating .form-control,
[dir="rtl"] .auth-floating .form-floating > .form-control {
    padding-left: 0.75rem;
    padding-right: 2.75rem;
}

[dir="rtl"] .auth-floating label {
    padding-left: 0.75rem;
    padding-right: 2.75rem;
}

.auth-eye-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    z-index: 4;
    padding: 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
}

.auth-eye-toggle:hover {
    color: #e8b645;
}

[dir="rtl"] .auth-eye-toggle {
    right: auto;
    left: 0.75rem;
}

.auth-floating .auth-input[type="password"],
.auth-floating .auth-input[type="text"] {
    padding-right: 2.75rem;
}

[dir="rtl"] .auth-floating .auth-input[type="password"],
[dir="rtl"] .auth-floating .auth-input[type="text"] {
    padding-right: 2.75rem;
    padding-left: 2.75rem;
}

.auth-alert {
    border-radius: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.auth-check {
    background-color: #0f1929;
    border-color: rgba(148, 163, 184, 0.3);
}

.auth-check:checked {
    background-color: #e8b645;
    border-color: #e8b645;
}

.auth-check:focus {
    box-shadow: 0 0 0 0.2rem rgba(232, 182, 69, 0.15);
}

.auth-check-label {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

[dir="rtl"] .auth-check-label {
    margin-left: 0;
    margin-right: 0.5rem;
}

.auth-link {
    text-align: center;
    margin-top: 1.25rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.auth-link a {
    color: #e8b645;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    color: #f0c760;
    text-decoration: underline;
}

.auth-status-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2rem;
}

.auth-status-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.auth-status-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.auth-animate-in {
    animation: authScaleIn 0.5s ease-out;
}

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

.auth-email-highlight {
    background: rgba(232, 182, 69, 0.1);
    border: 1px solid rgba(232, 182, 69, 0.25);
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: #e8b645;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    word-break: break-all;
}

.auth-error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: #ef4444;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.auth-captcha-label {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-captcha-input {
    max-width: 120px;
    height: calc(3rem + 2px) !important;
    padding-left: 1rem !important;
}

.auth-card .btn.landing-btn-gold {
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .auth-page {
        padding: 2rem 0;
        min-height: 70vh;
    }

    .auth-card {
        padding: 1.75rem;
    }

    .auth-logo {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .auth-title {
        font-size: 1.3rem;
    }
}
