/* ==================== HAFIZ GLOBAL STYLES ==================== */
/* Single source of truth for design tokens, typography, and utilities */

/* Design Tokens */
:root {
    --hafiz-primary: #0a5f59;
    --hafiz-secondary: #084a45;
    --hafiz-accent: #e4a520;
    --hafiz-background: #f8fffe;
    --hafiz-surface: #ffffff;
    --hafiz-text: #333333;
    --hafiz-text-muted: #666666;
    --hafiz-border: rgba(10, 95, 89, 0.1);
    --hafiz-success: #25d366;
    --hafiz-danger: #dc3545;
    --hafiz-warning: #e4a520;

    --hafiz-font-primary: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --hafiz-radius-sm: 8px;
    --hafiz-radius-md: 12px;
    --hafiz-radius-lg: 15px;
    --hafiz-radius-xl: 20px;
    --hafiz-radius-pill: 50px;

    --hafiz-shadow-sm: 0 2px 10px rgba(10, 95, 89, 0.08);
    --hafiz-shadow-md: 0 10px 30px rgba(10, 95, 89, 0.1);
    --hafiz-shadow-lg: 0 20px 60px rgba(10, 95, 89, 0.15);

    --hafiz-gradient-primary: linear-gradient(135deg, #0a5f59 0%, #084a45 100%);
    --hafiz-gradient-accent: linear-gradient(135deg, #0a5f59 0%, #e4a520 100%);
}

/* Typography - defined ONCE, no !important */
body {
    font-family: var(--hafiz-font-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Global Container */
.global-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent Horizontal Overflow */
body {
    overflow-x: hidden;
}

/* Keyboard Focus Indicators - Accessibility */
:focus-visible {
    outline: 3px solid var(--hafiz-accent);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--hafiz-accent);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 3px solid var(--hafiz-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(228, 165, 32, 0.25);
}

.nav-link:focus-visible,
.mobile-nav-link:focus-visible {
    outline: 3px solid var(--hafiz-accent);
    outline-offset: 2px;
    border-radius: var(--hafiz-radius-sm);
}

.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: var(--hafiz-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--hafiz-radius-sm);
    text-decoration: none;
    font-weight: 600;
}

/* Back to Top Button - matches original design */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--hafiz-primary), var(--hafiz-secondary));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(10, 95, 89, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.back-to-top-btn:hover {
    background: linear-gradient(135deg, var(--hafiz-accent), #d4a017);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 40px rgba(228, 165, 32, 0.4);
    color: var(--hafiz-primary);
}

.back-to-top-btn:active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(10, 95, 89, 0.3);
}

.back-to-top-btn i {
    transition: transform 0.3s ease;
}

.back-to-top-btn:hover i {
    transform: translateY(-2px);
}

.back-to-top-btn.show {
    display: flex;
}

@media (max-width: 768px) {
    .back-to-top-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .back-to-top-btn {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 16px;
    }
}

/* Navbar Scroll Effect */
.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* Lazy Loading */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* Form Validation */
.is-invalid {
    border-color: var(--hafiz-danger) !important;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Alert Styling */
.alert {
    border-radius: var(--hafiz-radius-md);
    padding: 15px 20px;
    margin-bottom: 20px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--hafiz-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hafiz-secondary);
}
