/* ==============================================================================
   5G Dimensioning Tool - Stylesheet (Final Version)
   تصميم متجاوب (Mobile-First) مع دعم كامل للغة العربية
   ============================================================================== */

/* --------------------------------------------------------------------------
   1. إعدادات عامة (General Settings)
   -------------------------------------------------------------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* الألوان الأساسية */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --error-color: #ef4444;
    
    /* الألوان الخلفية */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --input-bg: #f1f5f9;
    
    /* الألوان النصية */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    /* الظلال */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    /* الحدود */
    --border-radius: 12px;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   2. رأس الصفحة (Header)
   -------------------------------------------------------------------------- */

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   3. المحتوى الرئيسي (Main Content)
   -------------------------------------------------------------------------- */

main {
    padding: 30px;
}

.form-section {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.form-section h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .form-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--input-bg);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-group small {
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   4. الأزرار (Buttons)
   -------------------------------------------------------------------------- */

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   5. قسم النتائج (Results Section)
   -------------------------------------------------------------------------- */

.results-section {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-top: 30px;
    border: 2px solid var(--secondary-color);
}

.results-section h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 25px;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.result-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.result-card.highlight {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #059669 100%);
    color: white;
    border-color: var(--secondary-color);
}

.result-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

.result-card.highlight h3 {
    color: rgba(255, 255, 255, 0.95);
}

.result-card .result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 10px 0;
}

.result-card.highlight .result-value {
    color: white;
}

.result-card .result-unit {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.result-card.highlight .result-unit {
    color: rgba(255, 255, 255, 0.85);
}

/* --------------------------------------------------------------------------
   6. رسائل الأخطاء (Error Messages)
   -------------------------------------------------------------------------- */

.error-message {
    background: #fee2e2;
    border: 2px solid var(--error-color);
    color: #991b1b;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 600;
    text-align: center;
}

/* --------------------------------------------------------------------------
   7. تذييل الصفحة (Footer)
   -------------------------------------------------------------------------- */

footer {
    background: var(--bg-color);
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

footer strong {
    color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   8. تحسينات للأجهزة المحمولة (Mobile Enhancements)
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 25px 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header .subtitle {
        font-size: 0.9rem;
    }
    
    main {
        padding: 20px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .form-section h2 {
        font-size: 1.3rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .result-card .result-value {
        font-size: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   9. تحسينات الطباعة (Print Styles)
   -------------------------------------------------------------------------- */

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
    }
    
    .form-actions {
        display: none;
    }
    
    .form-section {
        page-break-inside: avoid;
    }
}

