/**
 * ملف التصميم الرئيسي - IPS Admission System
 * Main Stylesheet - Modern & Responsive Design
 * Version: 2.0
 */

/* ============================================
   Variables & Reset
   ============================================ */
:root {
    --primary-color: #B22222;
    --primary-dark: #8B1A1A;
    --primary-light: #DC143C;
    --secondary-color: #008080;
    --accent-color: #FFD700;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --border-color: #E0E0E0;
    --success-color: #28A745;
    --error-color: #DC3545;
    --warning-color: #FFC107;
    --info-color: #17A2B8;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --font-primary: 'Open Sans', 'Segoe UI', Tahoma, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    direction: ltr;
}

body[dir="rtl"] {
    direction: rtl;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.header-title-section {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.header-logo {
    height: 60px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
}

.logo-section img {
    height: 80px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .header-logo,
    .logo-section img {
        height: 45px;
        max-width: 70px;
    }
    
    .header {
        padding: 0.4rem 0;
    }
    
    .header-container {
        gap: 8px;
        padding: 0 15px;
        flex-wrap: nowrap;
    }
    
    .header-title-section {
        flex: 1;
        min-width: 0;
    }
    
    .site-title {
        font-size: 0.95rem;
        line-height: 1.2;
        margin: 0;
    }
    
    .logo-section {
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .header-logo,
    .logo-section img {
        height: 35px;
        max-width: 60px;
    }
    
    .header {
        padding: 0.3rem 0;
    }
    
    .header-container {
        gap: 5px;
        padding: 0 10px;
    }
    
    .site-title {
        font-size: 0.85rem;
    }
    
    .logo-section {
        gap: 5px;
    }
}

.site-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: var(--bg-white);
    font-size: 3rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--bg-white);
}

.btn-secondary:hover {
    background: #006666;
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.card-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-family: var(--font-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.1);
}

.form-control:disabled {
    background-color: var(--bg-light);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-error {
    background-color: #F8D7DA;
    border-color: var(--error-color);
    color: #721C24;
}

.alert-success {
    background-color: #D4EDDA;
    border-color: var(--success-color);
    color: #155724;
}

.alert-warning {
    background-color: #FFF3CD;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background-color: #D1ECF1;
    border-color: var(--info-color);
    color: #0C5460;
}

/* ============================================
   Container & Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--text-dark);
    color: var(--bg-white);
    padding: 2rem 20px;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    margin: 0;
    opacity: 0.8;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .header-container {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 8px;
    }
    
    .header-logo {
        height: 45px;
        max-width: 70px;
    }
    
    .header-title-section {
        flex: 1;
        min-width: 0;
    }
    
    .site-title {
        font-size: 1rem;
        line-height: 1.2;
        margin: 0;
    }
    
    .logo-section {
        gap: 5px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .card {
        padding: 1.5rem;
    }
    
    .btn-large {
        padding: 14px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 15px;
    }
    
    .section {
        padding: 40px 15px;
    }
    
    .card {
        padding: 1rem;
    }
    
    .header {
        padding: 0.3rem 0;
    }
    
    .header-container {
        padding: 0 10px;
        gap: 5px;
    }
    
    .header-logo {
        height: 35px;
        max-width: 60px;
    }
    
    .site-title {
        font-size: 0.85rem;
    }
    
    .header-title-section small {
        font-size: 0.65rem;
    }
}

/* ============================================
   Utilities
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

