/* ========================================
   RESPONSIVE DESIGN - AUTO-FIT ALL SCREENS
   ======================================== */

/* Base Responsive Settings */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container adjustments for all screen sizes */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* ========================================
   MOBILE FIRST - Base Styles (320px+)
   ======================================== */

/* Typography for mobile */
h1, .display-4 {
    font-size: 1.75rem !important;
    line-height: 1.2;
}

h2, .display-5 {
    font-size: 1.5rem !important;
}

h3 {
    font-size: 1.25rem !important;
}

h4 {
    font-size: 1.1rem !important;
}

p, .lead {
    font-size: 0.95rem !important;
    line-height: 1.6;
}

/* Navigation - Mobile */
.navbar {
    padding: 0.5rem 0;
}

.navbar-brand {
    font-size: 1.1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

/* Hero Section - Mobile */
.hero-section {
    padding: 2rem 0 !important;
    min-height: auto !important;
}

.hero-title {
    font-size: 1.5rem !important;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 0.9rem !important;
    margin-bottom: 1.5rem;
}

/* Buttons - Mobile */
.btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-lg {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
}

/* Feature Cards - Mobile Stack */
.feature-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.feature-icon {
    font-size: 2rem !important;
    margin-bottom: 1rem;
}

/* Footer - Mobile */
footer {
    padding: 2rem 0 !important;
    text-align: center;
}

footer .col-md-4 {
    margin-bottom: 1.5rem;
}

footer h5 {
    font-size: 1.1rem;
}

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

table {
    font-size: 0.85rem;
    min-width: 600px;
}

/* Forms - Mobile */
.form-control {
    font-size: 0.95rem;
    padding: 0.6rem 0.75rem;
}

/* Cards - Mobile */
.card {
    margin-bottom: 1rem;
}

.card-body {
    padding: 1rem;
}

/* Images in content - Mobile */
.img-fluid {
    width: 100%;
    height: auto;
}

/* Spacing - Mobile */
.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

.my-5 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
}

/* ========================================
   TABLET - Small (576px and up)
   ======================================== */
@media (min-width: 576px) {
    h1, .display-4 {
        font-size: 2.25rem !important;
    }

    h2, .display-5 {
        font-size: 1.85rem !important;
    }

    p, .lead {
        font-size: 1rem !important;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }

    .btn {
        font-size: 0.95rem;
    }

    .container {
        max-width: 540px;
    }

    .feature-card {
        padding: 2rem;
    }

    table {
        font-size: 0.9rem;
    }
}

/* ========================================
   TABLET - Medium (768px and up)
   ======================================== */
@media (min-width: 768px) {
    h1, .display-4 {
        font-size: 2.5rem !important;
    }

    h2, .display-5 {
        font-size: 2rem !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }

    p, .lead {
        font-size: 1.05rem !important;
    }

    .hero-section {
        padding: 3rem 0 !important;
    }

    .hero-title {
        font-size: 2.25rem !important;
    }

    .hero-subtitle {
        font-size: 1.1rem !important;
    }

    .container {
        max-width: 720px;
    }

    .py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .my-5 {
        margin-top: 3rem !important;
        margin-bottom: 3rem !important;
    }

    footer {
        text-align: left;
    }

    table {
        font-size: 0.95rem;
    }

    .card-body {
        padding: 1.5rem;
    }
}

/* ========================================
   DESKTOP - Large (992px and up)
   ======================================== */
@media (min-width: 992px) {
    h1, .display-4 {
        font-size: 3rem !important;
    }

    h2, .display-5 {
        font-size: 2.5rem !important;
    }

    h3 {
        font-size: 1.75rem !important;
    }

    h4 {
        font-size: 1.5rem !important;
    }

    p, .lead {
        font-size: 1.1rem !important;
    }

    .hero-section {
        padding: 4rem 0 !important;
        min-height: 600px;
    }

    .hero-title {
        font-size: 2.75rem !important;
    }

    .hero-subtitle {
        font-size: 1.2rem !important;
    }

    .container {
        max-width: 960px;
    }

    .py-5 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    .my-5 {
        margin-top: 4rem !important;
        margin-bottom: 4rem !important;
    }

    .feature-card {
        padding: 2.5rem;
    }

    table {
        font-size: 1rem;
        min-width: auto;
    }

    .card-body {
        padding: 2rem;
    }
}

/* ========================================
   DESKTOP - Extra Large (1200px and up)
   ======================================== */
@media (min-width: 1200px) {
    h1, .display-4 {
        font-size: 3.5rem !important;
    }

    h2, .display-5 {
        font-size: 3rem !important;
    }

    .hero-title {
        font-size: 3rem !important;
    }

    .hero-subtitle {
        font-size: 1.25rem !important;
    }

    .container {
        max-width: 1140px;
    }

    .feature-card {
        padding: 3rem;
    }
}

/* ========================================
   DESKTOP - XXL (1400px and up)
   ======================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    h1, .display-4 {
        font-size: 4rem !important;
    }

    h2, .display-5 {
        font-size: 3.25rem !important;
    }
}

/* ========================================
   UTILITY CLASSES FOR RESPONSIVE SPACING
   ======================================== */

/* Responsive padding */
.p-responsive {
    padding: 1rem;
}

@media (min-width: 768px) {
    .p-responsive {
        padding: 2rem;
    }
}

@media (min-width: 992px) {
    .p-responsive {
        padding: 3rem;
    }
}

/* Responsive margin */
.m-responsive {
    margin: 1rem;
}

@media (min-width: 768px) {
    .m-responsive {
        margin: 2rem;
    }
}

@media (min-width: 992px) {
    .m-responsive {
        margin: 3rem;
    }
}

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Center on mobile */
@media (max-width: 767px) {
    .center-mobile {
        text-align: center !important;
    }

    .center-mobile img {
        margin-left: auto;
        margin-right: auto;
    }
}

/* ========================================
   RESPONSIVE GRID IMPROVEMENTS
   ======================================== */

/* Stack columns on mobile */
@media (max-width: 767px) {
    .row > [class*="col-"] {
        margin-bottom: 1.5rem;
    }

    .row > [class*="col-"]:last-child {
        margin-bottom: 0;
    }
}

/* ========================================
   RESPONSIVE NAVBAR IMPROVEMENTS
   ======================================== */

@media (max-width: 991px) {
    .navbar-collapse {
        padding: 1rem 0;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    .navbar .d-flex {
        margin-top: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .navbar .d-flex .btn {
        width: 100%;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */

/* Larger touch targets for mobile */
@media (max-width: 767px) {
    a, button, .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-link {
        min-height: 48px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .navbar, footer, .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    h1 {
        font-size: 18pt !important;
    }

    h2 {
        font-size: 16pt !important;
    }

    h3 {
        font-size: 14pt !important;
    }
}
