/* Global Responsive Styles */

/* Base responsive rules */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive containers */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (max-width: 1200px) {
    .container {
        max-width: 96%;
        padding: 0 15px;
    }
}

/* Responsive typography */
h1 {
    font-size: 2.5rem;
}
h2 {
    font-size: 2rem;
}
h3 {
    font-size: 1.75rem;
}
h4 {
    font-size: 1.5rem;
}
h5 {
    font-size: 1.25rem;
}
h6 {
    font-size: 1rem;
}

@media (max-width: 768px) {
    h1, .h1 {
        font-size: calc(2rem + 1vw);
    }
    
    h2, .h2 {
        font-size: calc(1.5rem + 1vw);
    }
    
    h3, .h3 {
        font-size: calc(1.2rem + 0.5vw);
    }
    
    body {
        font-size: 0.95rem;
    }
    
    .section-title {
        margin-bottom: 1.5rem;
    }
    
    section {
        padding: 50px 0;
    }
}

/* Responsive iframe */
.responsive-iframe {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
}

.responsive-iframe iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Touch-friendly interactive elements */
button,
[type="button"],
[type="reset"],
[type="submit"],
.btn,
select,
a.btn,
a.button {
    min-height: 44px;
    min-width: 44px;
}

@media (max-width: 992px) {
    input, select, textarea, button {
        font-size: 16px; /* Prevents zoom on focus in iOS */
    }
    
    a, button {
        min-height: 44px; /* Better touch targets */
        display: inline-flex;
        align-items: center;
    }
}

/* Spacing utilities */
.my-1 {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}
.my-2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.my-3 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.my-4 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
.my-5 {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}
.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}
.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

@media (max-width: 576px) {
    .btn, button {
        padding: 0.6rem 1.2rem;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col, [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Responsive table */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Improved mobile navigation handling */
@media (max-width: 768px) {
    .back-to-top {
        right: 15px;
        bottom: 15px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Responsive utilities */
.d-sm-none {
    display: none !important;
}

@media (min-width: 576px) {
    .d-sm-none {
        display: initial !important;
    }
    .d-sm-block {
        display: block !important;
    }
}

.text-sm-center {
    text-align: center;
}

@media (min-width: 576px) {
    .text-sm-left {
        text-align: left !important;
    }
}

/* Responsive media queries - larger breakpoints */
@media screen and (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media screen and (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    h1 {
        font-size: 3rem;
    }
    h2 {
        font-size: 2.5rem;
    }
    h3 {
        font-size: 2rem;
    }
    h4 {
        font-size: 1.75rem;
    }
    h5 {
        font-size: 1.5rem;
    }
    h6 {
        font-size: 1.25rem;
    }
}

@media screen and (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media screen and (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    body {
        font-size: 12pt;
    }
}
