/* =====================================================
   AZAL Airlines - Base Styles (Reset + Typography + Global)
   ===================================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-arabic);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text);
    background-color: var(--color-bg);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-arabic);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-4xl);
    font-weight: var(--font-extrabold);
}

h2 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
}

h3 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
}

h4 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
}

h5 {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
}

h6 {
    font-size: var(--text-md);
    font-weight: var(--font-medium);
}

p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-loose);
    color: var(--color-text-secondary);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    outline: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ---- Selection ---- */
::selection {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-dark);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ---- Utility Classes ---- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-sm {
    max-width: var(--container-sm);
}

.container-lg {
    max-width: var(--container-lg);
}

.section {
    padding: var(--space-20) 0;
}

.section-sm {
    padding: var(--space-12) 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-secondary); }
.text-white { color: #fff; }

.font-en { font-family: var(--font-english); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Page Wrapper ---- */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn 0.5s ease both; }
.animate-fade-up { animation: fadeInUp 0.5s ease both; }
.animate-fade-down { animation: fadeInDown 0.5s ease both; }
.animate-slide-right { animation: slideInRight 0.5s ease both; }
.animate-slide-left { animation: slideInLeft 0.5s ease both; }
.animate-scale-in { animation: scaleIn 0.3s ease both; }

/* Staggered animation delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* ---- Toast / Notification ---- */
.toast-container {
    position: fixed;
    top: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    color: #fff;
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    animation: fadeInDown 0.3s ease, fadeIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    text-align: center;
}

.toast-success { background-color: var(--color-success); }
.toast-error { background-color: var(--color-error); }
.toast-warning { background-color: var(--color-warning); }
.toast-info { background-color: var(--color-info); }

/* ---- Loading Spinner ---- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ---- Overlay ---- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}
