/* ========================================
   MAIN.CSS - Common Styles for All Pages
   ======================================== */

/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --color-primary: #6D94C5;
    --color-primary-dark: #5a7ba8;
    --color-secondary: #E8DFCA;
    --color-secondary-dark: #d4c9b3;
    --color-background: #CBDCEB;
    --color-surface: rgba(245, 239, 230, 0.98);
    --color-surface-alt: rgba(245, 239, 230, 0.95);

    /* Text Colors */
    --color-text-primary: #2c3e50;
    --color-text-secondary: #5a6c7d;
    --color-text-tertiary: #34495e;
    --color-text-muted: #95a5a6;
    --color-text-light: #7f8c8d;

    /* Borders */
    --border-color: #E8DFCA;
    --border-width: 2px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 14px;
    --radius-2xl: 16px;
    --radius-3xl: 20px;
    --radius-4xl: 24px;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 40px;
    --spacing-4xl: 48px;

    /* Shadows */
    --shadow-sm: 0 4px 15px rgba(109, 148, 197, 0.1);
    --shadow-md: 0 8px 24px rgba(109, 148, 197, 0.2);
    --shadow-lg: 0 12px 35px rgba(109, 148, 197, 0.3);
    --shadow-xl: 0 16px 45px rgba(109, 148, 197, 0.4);
    --shadow-2xl: 0 20px 60px rgba(109, 148, 197, 0.5);

    /* Typography */
    --font-family: 'Cairo', sans-serif;
    --font-weight-normal: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: 0.6s ease;

    /* Z-index */
    --z-background: 0;
    --z-content: 10;
    --z-header: 100;
    --z-modal: 1000;
}

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

body {
    font-family: var(--font-family);
    min-height: 100vh;
    background: var(--color-background);
    direction: rtl;
    position: relative;
    overflow-x: hidden;
}

/* ===== Background Effects ===== */
body::before {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    opacity: 0.4;
    z-index: var(--z-background);
}

body::after {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-secondary) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    border-radius: 50%;
    opacity: 0.3;
    z-index: var(--z-background);
}

.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: var(--z-background);
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 0.08;
}

.shape1 {
    width: 300px;
    height: 300px;
    background: var(--color-primary);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: 10%;
    left: 5%;
    animation: float 20s infinite ease-in-out;
}

.shape2 {
    width: 200px;
    height: 200px;
    background: var(--color-secondary);
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    bottom: 15%;
    right: 10%;
    animation: float 15s infinite ease-in-out reverse;
}

.shape3 {
    width: 250px;
    height: 250px;
    background: var(--color-primary);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    top: 50%;
    right: 5%;
    animation: float 18s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(10deg);
    }
}

/* ===== Animations ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-extrabold);
}

p {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-normal);
    line-height: 1.7;
}

/* ===== Form Elements ===== */
label {
    display: block;
    font-size: 15px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-tertiary);
    margin-bottom: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

label:first-of-type {
    margin-top: 0;
}

label.optional::after {
    content: '(اختياري)';
    font-size: 13px;
    font-weight: var(--font-weight-normal);
    color: var(--color-text-muted);
    margin-right: var(--spacing-xs);
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 14px 16px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-family: var(--font-family);
    transition: all var(--transition-smooth);
    background: white;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-normal);
    margin-bottom: var(--spacing-sm);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(109, 148, 197, 0.12);
    transform: translateY(-2px);
}

textarea::placeholder,
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder {
    color: var(--color-text-muted);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236D94C5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
    padding-left: 40px;
}

/* ===== Radio and Checkbox Styling ===== */
label input[type="radio"],
label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-left: 10px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

label:has(input[type="radio"]),
label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: var(--font-weight-semibold);
}

label:has(input[type="radio"]):hover,
label:has(input[type="checkbox"]):hover {
    border-color: var(--color-primary);
    background: rgba(109, 148, 197, 0.05);
    transform: translateX(-3px);
}

label:has(input[type="radio"]:checked),
label:has(input[type="checkbox"]:checked) {
    border-color: var(--color-primary);
    background: rgba(109, 148, 197, 0.1);
}

/* ===== Buttons ===== */
button {
    font-family: var(--font-family);
    font-weight: var(--font-weight-extrabold);
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    border: none;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary,
button[type="submit"] {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 16px;
    border-radius: var(--radius-xl);
    font-size: 17px;
    box-shadow: var(--shadow-lg);
}

.btn-primary::before,
button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform var(--transition-bounce);
}

.btn-primary:hover::before,
button[type="submit"]:hover::before {
    transform: translateX(100%);
}

.btn-primary:hover,
button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active,
button[type="submit"]:active {
    transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary,
button[type="reset"] {
    background: white;
    color: var(--color-text-primary);
    border: var(--border-width) solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-xl);
    font-size: 17px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover,
button[type="reset"]:hover {
    border-color: var(--color-primary);
    background: var(--color-background);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:active,
button[type="reset"]:active {
    transform: translateY(-1px);
}

/* ===== Links ===== */
a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-bold);
    transition: all var(--transition-fast);
    position: relative;
}

a:hover {
    color: var(--color-primary-dark);
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--color-primary);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-muted {
    color: var(--color-text-muted);
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.mt-5 {
    margin-top: var(--spacing-xl);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.mb-5 {
    margin-bottom: var(--spacing-xl);
}

/* ===== Responsive Design Base ===== */
@media (max-width: 768px) {
    body {
        padding: 24px 16px;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-2xl: 24px;
        --spacing-3xl: 32px;
    }
}
