/* Responsive Design Breakpoints and Mobile-First Approach */

/* Extra Small Devices (phones, up to 576px) */
@media (max-width: 575.98px) {
    :root {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .page-hero {
        padding: 2rem 0;
    }
    
    .page-hero .lead {
        font-size: 0.9rem;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .nav-link {
        padding: 0.5rem 0 !important;
        margin: 0.25rem 0 !important;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .feature-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-footer {
        padding: 0.75rem 1rem;
    }
    
    .blog-card {
        margin-bottom: 1.5rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    .newsletter-form button {
        width: 100%;
    }
    
    .testimonial-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .faq-item {
        padding: 1rem 0;
    }
    
    .faq-question {
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    .footer-section {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .footer-section h6 {
        margin-bottom: 1rem;
        font-size: 0.85rem;
    }
    
    .footer-section .social-links {
        justify-content: center;
    }
    
    .footer-section ul {
        display: flex;
        flex-direction: column;
    }
    
    .footer-section ul li {
        margin-bottom: 0.5rem;
    }
    
    .pagination {
        font-size: 0.85rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    :root {
        font-size: 15px;
    }
    
    .container {
        max-width: 720px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    section {
        padding: 2.5rem 0;
    }
    
    .feature-icon {
        width: 65px;
        height: 65px;
    }
    
    .btn-group {
        flex-direction: row;
    }
    
    .btn-group .btn {
        width: auto;
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
    
    .newsletter-form {
        flex-direction: row;
    }
    
    .newsletter-form input {
        width: auto;
        flex: 1;
    }
    
    .footer-section {
        text-align: left;
    }
    
    .footer-section .social-links {
        justify-content: flex-start;
    }
    
    .card-columns {
        column-count: 2;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
    :root {
        font-size: 16px;
    }
    
    .container {
        max-width: 960px;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    h3 {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 3.5rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .page-hero {
        padding: 5rem 0;
    }
    
    .feature-card {
        padding: 2rem;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .nav-link {
        margin: 0 1rem;
    }
    
    .testimonial-card {
        padding: 2rem;
    }
    
    .card-columns {
        column-count: 3;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .page-hero {
        padding: 6rem 0;
    }
    
    section {
        padding: 3.5rem 0;
    }
}

/* Ultra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 600px) {
    .page-hero {
        padding: 1.5rem 0;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* Tablet Landscape */
@media (min-width: 768px) and (orientation: landscape) {
    .page-hero {
        padding: 3rem 0;
    }
}

/* High Density Displays (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 0.75rem 1.25rem;
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control {
        padding: 0.75rem 1rem;
        min-height: 44px;
        font-size: 16px;
    }
    
    a {
        padding: 0.5rem;
        margin: -0.5rem;
    }
    
    .nav-link::after {
        display: none;
    }
}

/* Print Media */
@media print {
    .navbar,
    .footer,
    .breadcrumb,
    .pagination,
    .btn-group,
    .newsletter-section {
        display: none;
    }
    
    body {
        background-color: #fff;
        color: #000;
    }
    
    a {
        text-decoration: underline;
    }
    
    .page-hero {
        background: #f0f0f0;
        box-shadow: none;
    }
}

/* Dark Mode Support (Future) */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #1a1a1a;
        --border-color: #333;
    }
    
    body {
        background-color: #0d0d0d;
        color: #e0e0e0;
    }
}

/* Accessibility: Focus Visible */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Sticky Elements on Scroll */
@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 20px;
        height: fit-content;
    }
}

/* Table Responsive */
@media (max-width: 768px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    .table {
        min-width: 500px;
    }
}

/* Grid Layouts */
@media (max-width: 768px) {
    [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

/* Modals and Overlays */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

/* Navigation Mobile Menu */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: #fff;
        border-top: 1px solid var(--border-color);
        margin-top: 1rem;
        padding: 1rem 0;
    }
    
    .nav-item {
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
}
