/* Responsive Styles */

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Large devices (desktops, 992px to 1199px) */
@media (max-width: 1199px) {
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Medium devices (tablets, 768px to 991px) */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: white;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        margin-top: 10px;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .profile-image-wrapper {
        margin-bottom: 30px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .timeline:before {
        right: 20px;
    }
    
    .timeline-item:before {
        right: 20px;
    }
    
    .timeline-content {
        margin-right: 50px;
    }
}

/* Small devices (landscape phones, 576px to 767px) */
@media (max-width: 767px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .hero-section {
        padding: 60px 0;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .stat-card {
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    footer {
        padding: 40px 0 20px;
    }
    
    .footer-links {
        margin-bottom: 30px;
    }
    
    .social-links {
        text-align: center;
        margin-top: 20px;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    body {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .navbar {
        padding: 10px 0;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .hero-section .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        padding: 15px;
    }
}

/* Print specific responsive styles */
@media print {
    @page {
        margin: 0.5cm;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .hero-section,
    .section {
        padding: 20px 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
    
    .btn,
    .navbar,
    footer,
    .social-links,
    .no-print {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .break-after {
        page-break-after: always;
    }
    
    .break-before {
        page-break-before: always;
    }
    
    .break-inside-avoid {
        page-break-inside: avoid;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-section:before {
        background-image: url('../images/pattern@2x.png');
        background-size: 200px 200px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card,
    .btn,
    .social-links a {
        transition: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2d3748;
        --dark-color: #f7fafc;
    }
    
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }
    
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .card-header {
        background-color: #4a5568;
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }
    
    .form-control {
        background-color: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .form-control:focus {
        background-color: #4a5568;
        color: #e2e8f0;
    }
    
    .table {
        color: #e2e8f0;
    }
    
    .table th,
    .table td {
        border-color: #4a5568;
    }
    
    .table thead th {
        background-color: #4a5568;
        border-bottom-color: #718096;
    }
    
    .table-striped tbody tr:nth-of-type(odd) {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        padding: 40px 0;
        min-height: auto;
    }
    
    .navbar {
        position: static;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .hero-section h1 {
        font-size: 1.25rem;
    }
    
    .hero-section .lead {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 6px 15px;
        font-size: 0.8rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
}

/* Bootstrap overrides for RTL */
@media (max-width: 991px) {
    .navbar-collapse {
        text-align: right;
    }
}

/* Custom breakpoints */
@media (max-width: 480px) {
    .modal-dialog {
        margin: 5px;
    }
    
    .modal-content {
        padding: 10px;
    }
    
    .alert {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Grid system adjustments */
@media (max-width: 767px) {
    .row {
        margin-right: -5px;
        margin-left: -5px;
    }
    
    [class*="col-"] {
        padding-right: 5px;
        padding-left: 5px;
    }
}

/* Utility classes for responsive */
.hidden-xs {
    @media (max-width: 575px) {
        display: none !important;
    }
}

.hidden-sm {
    @media (min-width: 576px) and (max-width: 767px) {
        display: none !important;
    }
}

.hidden-md {
    @media (min-width: 768px) and (max-width: 991px) {
        display: none !important;
    }
}

.hidden-lg {
    @media (min-width: 992px) and (max-width: 1199px) {
        display: none !important;
    }
}

.hidden-xl {
    @media (min-width: 1200px) {
        display: none !important;
    }
}

.visible-xs {
    @media (min-width: 576px) {
        display: none !important;
    }
}

.visible-sm {
    @media (max-width: 575px), (min-width: 768px) {
        display: none !important;
    }
}

.visible-md {
    @media (max-width: 767px), (min-width: 992px) {
        display: none !important;
    }
}

.visible-lg {
    @media (max-width: 991px), (min-width: 1200px) {
        display: none !important;
    }
}

.visible-xl {
    @media (max-width: 1199px) {
        display: none !important;
    }
}

/* Responsive typography */
@media (max-width: 767px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    .display-1 { font-size: 2.5rem; }
    .display-2 { font-size: 2rem; }
    .display-3 { font-size: 1.75rem; }
    .display-4 { font-size: 1.5rem; }
}

/* Responsive images */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    max-width: 100%;
    height: auto;
}

/* Responsive embeds */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.embed-responsive::before {
    display: block;
    content: "";
}

.embed-responsive-16by9::before {
    padding-top: 56.25%;
}

.embed-responsive-4by3::before {
    padding-top: 75%;
}

.embed-responsive-item {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive tables */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive forms */
@media (max-width: 767px) {
    .form-inline .form-control {
        display: inline-block;
        width: auto;
        vertical-align: middle;
    }
    
    .form-inline .form-control-plaintext {
        display: inline-block;
    }
    
    .form-inline .input-group {
        width: auto;
    }
}

/* Responsive buttons */
.btn-block {
    display: block;
    width: 100%;
}

@media (max-width: 767px) {
    .btn-group-vertical {
        width: 100%;
    }
    
    .btn-group-vertical > .btn {
        width: 100%;
    }
}

/* Responsive pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 575px) {
    .pagination {
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .pagination > .page-item {
        display: inline-block;
    }
}