/* Responsive Design - التصميم المتجاوب */

/* ===== Base Responsive Variables ===== */
:root {
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 1024px;
    --desktop-breakpoint: 1200px;
}

/* ===== Container Responsive ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
}

/* ===== Grid System ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-1 { flex: 0 0 8.333333%; }
.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-5 { flex: 0 0 41.666667%; }
.col-6 { flex: 0 0 50%; }
.col-7 { flex: 0 0 58.333333%; }
.col-8 { flex: 0 0 66.666667%; }
.col-9 { flex: 0 0 75%; }
.col-10 { flex: 0 0 83.333333%; }
.col-11 { flex: 0 0 91.666667%; }
.col-12 { flex: 0 0 100%; }

@media (max-width: 768px) {
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, 
    .col-md-5, .col-md-6, .col-md-7, .col-md-8, 
    .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
        flex: 0 0 100%;
    }
}

@media (max-width: 480px) {
    .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, 
    .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, 
    .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
        flex: 0 0 100%;
    }
}

/* ===== Typography Responsive ===== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
    
    .lead {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }
    
    .lead {
        font-size: 1rem;
    }
}

/* ===== Spacing Responsive ===== */
@media (max-width: 768px) {
    .py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    .py-4 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .py-3 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    
    .my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
    .my-4 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
    .my-3 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
}

@media (max-width: 480px) {
    .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    
    .my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
    .my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
    .my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
}

/* ===== Cards Responsive ===== */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
}

/* ===== Buttons Responsive ===== */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        min-height: 52px;
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .btn {
        min-height: 48px;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        min-height: 56px;
        padding: 1.125rem 1.75rem;
        font-size: 1rem;
    }
}

/* ===== Forms Responsive ===== */
@media (max-width: 768px) {
    .form-control {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .form-control {
        min-height: 48px;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.375rem;
    }
}

/* ===== Navigation Responsive ===== */
@media (max-width: 768px) {
    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .nav-link {
        padding: 1rem;
        text-align: center;
    }
}

/* ===== Tables Responsive ===== */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.375rem;
    }
}

/* ===== Images Responsive ===== */
@media (max-width: 768px) {
    .img-fluid {
        max-width: 100%;
        height: auto;
    }
    
    .img-thumbnail {
        max-width: 100%;
        height: auto;
    }
}

/* ===== Utilities Responsive ===== */
@media (max-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-inline { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-inline-flex { display: inline-flex !important; }
}

@media (max-width: 480px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
    .d-sm-inline { display: inline !important; }
    .d-sm-inline-block { display: inline-block !important; }
    .d-sm-inline-flex { display: inline-flex !important; }
}

/* ===== Text Alignment Responsive ===== */
@media (max-width: 768px) {
    .text-md-left { text-align: left !important; }
    .text-md-center { text-align: center !important; }
    .text-md-right { text-align: right !important; }
}

@media (max-width: 480px) {
    .text-sm-left { text-align: left !important; }
    .text-sm-center { text-align: center !important; }
    .text-sm-right { text-align: right !important; }
}

/* ===== Flexbox Responsive ===== */
@media (max-width: 768px) {
    .flex-md-column { flex-direction: column !important; }
    .flex-md-row { flex-direction: row !important; }
    .flex-md-wrap { flex-wrap: wrap !important; }
    .flex-md-nowrap { flex-wrap: nowrap !important; }
}

@media (max-width: 480px) {
    .flex-sm-column { flex-direction: column !important; }
    .flex-sm-row { flex-direction: row !important; }
    .flex-sm-wrap { flex-wrap: wrap !important; }
    .flex-sm-nowrap { flex-wrap: nowrap !important; }
}

/* ===== Visibility Responsive ===== */
@media (max-width: 768px) {
    .visible-md { visibility: visible !important; }
    .invisible-md { visibility: hidden !important; }
}

@media (max-width: 480px) {
    .visible-sm { visibility: visible !important; }
    .invisible-sm { visibility: hidden !important; }
}

/* ===== Print Styles ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .page-break {
        page-break-before: always;
    }
}