html {
    height: 100%;
    min-height: 100%;
}

body {
    min-height: 100%;
    height: auto;
    position: relative;
}

.boxed-container {
    min-height: 100vh;
    position: relative;
}

/* Ensure all sections extend properly */
section,
.vc_row,
.wpb_row {
    position: relative;
}

/* Fix for footer sticking to bottom */
footer {
    position: relative;
    width: 100%;
    clear: both;
}

/* ============================================
   TABLET LANDSCAPE (1024px and below)
   ============================================ */
@media (max-width: 1024px) {
    .boxed-container {
        max-width: 100%;
    }

    #header .thm-container {
        width: auto;
        padding: 0 15px;
    }

    .welcome_section .middle {
        width: auto;
        margin-left: 15px;
        margin-right: 15px;
    }

    .our_compaigns .width {
        width: 100%;
    }

    .testimonial_section {
        margin-left: 15px;
    }

    .testimonial_section.vc_row {
        margin-left: 15px;
    }
}

/* ============================================
   TABLET PORTRAIT (768px and below)
   ============================================ */
@media (max-width: 768px) {

    /* Typography adjustments */
    .tt-title {
        font-size: 24px;
        line-height: 32px;
    }

    .tt-subtitle {
        font-size: 18px;
        line-height: 24px;
    }

    .font40 {
        font-size: 28px !important;
    }

    .font32 {
        font-size: 24px !important;
    }

    .font28 {
        font-size: 22px !important;
    }

    .font24 {
        font-size: 20px !important;
    }

    /* Spacing adjustments */
    .mainPadding,
    .cellpadding {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .welcome_subsection {
        margin-top: 40px;
        margin-bottom: 30px;
    }

    .welcome_bottomsection {
        padding-top: 40px;
    }

    /* Header adjustments */
    #header .header_top {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    #header .header-right-info ul li {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }

    #header .social_icon ul li {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    /* Navigation */
    .nav-t-holder .nav-t-header {
        display: block;
    }

    .nav-t-holder .nav-t-footer {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.95);
        z-index: 9999;
        overflow-y: auto;
    }

    .nav-t-holder .nav-t-footer ul.nav > li {
        display: block;
        padding: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-t-holder .nav-t-footer ul.nav > li > a {
        padding: 15px 20px;
        display: block;
    }

    /* Image row */
    .tt-image-row {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .tt-image-row-bg {
        position: relative;
        width: 100%;
        height: 300px;
        margin-bottom: 30px;
    }

    .tt-feature.clearfix {
        border-right: 0;
        border-bottom: 1px solid #59754b;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .tt-feature.clearfix:last-child {
        border-bottom: 0;
    }

    /* Campaign section */
    .image-box .text {
        padding: 25px 15px 30px 15px;
    }

    .our_compaigns .owl-nav {
        position: relative;
        margin-top: 30px;
        text-align: center;
    }

    /* Events section */
    .upcoming_events .blank {
        width: 100%;
        display: block;
        margin-bottom: 15px;
    }

    .upcoming_events .content {
        display: block;
    }

    .right-section {
        margin-left: 0;
    }

    /* Mission section */
    .our_mission .mwidth1,
    .our_mission .mwidth2 {
        width: 100%;
    }

    /* News boxes */
    .news_box .text {
        padding: 20px;
    }

    /* Buttons */
    .c-btn.btn1 {
        margin-right: 0;
        margin-bottom: 15px;
        display: block;
        text-align: center;
    }

    .c-btn.btn2 {
        display: block;
        text-align: center;
        padding-left: 30px;
        padding-right: 30px;
    }
}

/* ============================================
   MOBILE LANDSCAPE (576px and below)
   ============================================ */
@media (max-width: 576px) {

    /* Typography */
    .tt-title {
        font-size: 20px;
        line-height: 28px;
    }

    .tt-subtitle {
        font-size: 16px;
        line-height: 22px;
    }

    .tt-featured-title {
        font-size: 16px;
    }

    .simple-text {
        font-size: 14px;
        line-height: 22px;
    }

    .font40 {
        font-size: 24px !important;
    }

    .font32 {
        font-size: 20px !important;
    }

    .font28 {
        font-size: 18px !important;
    }

    /* Spacing */
    .mainPadding,
    .cellpadding {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .marg-lg-b50 {
        margin-bottom: 30px;
    }

    .empty-space-mb-40 {
        margin-bottom: 25px;
    }

    .empty-space-mb-30 {
        margin-bottom: 20px;
    }

    /* Header */
    #header .nav_bg {
        margin-bottom: 0;
    }

    #header .nav-search {
        width: 100%;
    }

    #header .nav-search ul li a {
        padding: 12px 20px;
        font-size: 14px;
    }

    .logo.pull-left {
        padding-top: 0;
    }

    .responsive-logo img {
        display: block;
        width: 180px;
        margin-top: 10px;
    }

    /* Grid system for mobile */
    .grid-xs-12 {
        width: 100%;
    }

    [class*="grid-"] {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Touch targets - minimum 44x44px */
    .nav-t-holder .nav-t-footer ul.nav > li > a {
        min-height: 44px;
        padding: 14px 20px;
    }

    #header .social_icon ul li i {
        font-size: 18px;
        padding: 10px;
    }

    /* Image adjustments */
    .tt-image-row-bg {
        height: 250px;
    }

    .welcome_bottomsection .icon {
        width: 60px;
    }

    .tt-feature .image {
        width: 50px;
    }

    /* Events */
    .upcoming_events .date {
        padding: 8px 16px 10px 16px;
        width: 70px;
    }

    .upcoming_events .time p {
        border-right: 0;
        padding-right: 0;
        display: block;
        margin-bottom: 5px;
    }

    .upcoming_events .addres {
        margin-left: 0;
        display: block;
    }

    /* Progress bars */
    .single-progress {
        margin-top: 40px;
    }

    /* Testimonials */
    .text-brand {
        font-size: 16px;
        line-height: 24px;
    }

    .carousel-inner .name {
        font-size: 16px;
        margin-top: 15px;
    }

    /* Pagination */
    .page-numbers li span,
    .page-numbers li a {
        padding: 6px 12px;
        font-size: 16px;
    }

    /* Comments */
    .commentsWrapper form {
        padding: 30px 15px;
        padding-bottom: 50px;
    }

    .commentsWrapper .simple-input {
        font-size: 14px;
        line-height: 44px;
        height: 44px;
        padding: 0 15px;
    }

    /* Back to top button */
    div#btt {
        bottom: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 14px;
    }

    /* Carousel controls */
    .our_compaigns .owl-prev,
    .our_compaigns .owl-next {
        width: 40px;
        height: 40px;
    }

    .our_compaigns .fa-angle-left,
    .our_compaigns .fa-angle-right {
        font-size: 18px;
        padding: 8px 14px;
    }
}

/* ============================================
   MOBILE PORTRAIT (375px and below)
   ============================================ */
@media (max-width: 375px) {

    /* Extra small typography */
    .tt-title {
        font-size: 18px;
        line-height: 24px;
    }

    .font40 {
        font-size: 20px !important;
    }

    .font32 {
        font-size: 18px !important;
    }

    /* Spacing */
    .mainPadding,
    .cellpadding {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    /* Containers */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Buttons */
    .c-btn, .c-btn:focus {
        padding: 12px 20px;
        font-size: 12px;
    }

    .image-box .button .c-btn {
        padding: 10px 18px;
        font-size: 12px;
    }
}

/* ============================================
   UTILITY CLASSES FOR RESPONSIVE
   ============================================ */

/* Hide on mobile */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
}

/* Show only on mobile */
.visible-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .visible-mobile {
        display: block !important;
    }
}

/* Text alignment */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center !important;
    }

    .text-left-mobile {
        text-align: left !important;
    }
}

/* Full width on mobile */
@media (max-width: 768px) {
    .full-width-mobile {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION FIXES
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .mainPadding,
    .cellpadding {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    #header .header_top {
        padding-top: 15px;
        padding-bottom: 15px;
    }
}

/* ============================================
   HIGH DPI DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure images look crisp on retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}