/* responsive.css - Complete Responsive System */

/* ===== RESPONSIVE BREAKPOINTS SYSTEM ===== */
:root {
    /* Responsive breakpoints */
    --breakpoint-xs: 0px;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
    
    /* Mobile-first spacing */
    --space-xs-mobile: 0.5rem;
    --space-sm-mobile: 0.75rem;
    --space-md-mobile: 1rem;
    --space-lg-mobile: 1.5rem;
    --space-xl-mobile: 2rem;
    
    /* Desktop spacing */
    --space-xs-desktop: 0.5rem;
    --space-sm-desktop: 1rem;
    --space-md-desktop: 2rem;
    --space-lg-desktop: 3rem;
    --space-xl-desktop: 4rem;
}

/* ===== RESPONSIVE CONTAINER SYSTEM ===== */
.container {
    width: 100%;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Mobile-first container widths */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ===== GLOBAL RESPONSIVE FIXES ===== */

/* Base mobile adjustments */
@media (max-width: 767px) {
    /* Fix horizontal scroll */
    html, body {
        overflow-x: hidden;
        max-width: 100%;
        width: 100%;
    }
    
    /* Mobile typography */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
    }
    
    h4 {
        font-size: 1.25rem !important;
    }
    
    /* Section spacing */
    section {
        padding: 2rem 0 !important;
    }
    
    /* Container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    section {
        padding: 3rem 0 !important;
    }
}

/* ===== NAVBAR RESPONSIVE FIXES ===== */
@media (max-width: 991px) {
    .nav-container {
        padding: 0.5rem 0 !important;
    }
    
    .logo {
        gap: 1rem !important;
    }
    
    .logo-icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .logo-title {
        font-size: 1.2rem !important;
    }
    
    .logo-subtitle {
        font-size: 0.8rem !important;
    }
    
    .logo-tagline {
        font-size: 0.7rem !important;
        display: none; /* Hide tagline on mobile */
    }
    
    .navbar.scrolled .logo-icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* Mobile menu button */
    .menu-toggle {
        display: flex !important;
        z-index: 1001;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--light);
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        gap: 1rem;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .nav-item:last-child {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0,0,0,0.1);
    }
    
    .nav-item:last-child .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== HERO SECTION RESPONSIVE ===== */
@media (max-width: 767px) {
    .hero {
        padding-top: 80px !important;
        min-height: auto !important;
        padding-bottom: 3rem !important;
    }
    
    .hero-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-description {
        font-size: 1rem !important;
        max-width: 100% !important;
        margin: 0 auto 1.5rem !important;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .impact-stats {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .hero-content {
        gap: 3rem !important;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
}

/* ===== EDUCATION PAGE HERO RESPONSIVE ===== */
@media (max-width: 767px) {
    .education-hero-section {
        padding: 100px 0 2rem !important;
        min-height: auto !important;
    }
    
    .hero-content-wrapper {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .title-line {
        display: inline !important;
    }
    
    .hero-description {
        font-size: 1rem !important;
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .stat-item {
        padding: 0.75rem !important;
    }
    
    .stat-number {
        font-size: 1.5rem !important;
    }
    
    .stat-label {
        font-size: 0.8rem !important;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .floating-cards-container {
        height: auto !important;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .floating-card {
        position: relative !important;
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto !important;
        transform: none !important;
    }
}

/* ===== GALLERY/CAROUSEL RESPONSIVE ===== */
@media (max-width: 767px) {
    .gallery-section {
        padding: 2rem 0 !important;
    }
    
    .carousel-slide {
        flex-direction: column;
    }
    
    .slide-image {
        height: 250px !important;
    }
    
    .slide-content {
        padding: 1rem !important;
        position: relative !important;
        transform: none !important;
        background: linear-gradient(to top, rgba(10, 110, 79, 0.95), rgba(10, 110, 79, 0.8)) !important;
    }
    
    .slide-content h3 {
        font-size: 1.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .slide-content p {
        font-size: 0.9rem !important;
    }
    
    .carousel-nav {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
    
    .carousel-nav.prev {
        left: 0.5rem !important;
    }
    
    .carousel-nav.next {
        right: 0.5rem !important;
    }
    
    .carousel-indicators {
        bottom: 0.5rem !important;
    }
    
    .indicator {
        width: 8px !important;
        height: 8px !important;
    }
    
    .carousel-controls {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem !important;
    }
    
    .carousel-controls .btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* ===== FOUNDER SECTION RESPONSIVE ===== */
@media (max-width: 767px) {
    .founder-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center;
    }
    
    .image-frame {
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    
    .president-image {
        border-width: 5px !important;
    }
    
    .founder-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        padding: 1rem !important;
    }
    
    .founder-stat .stat-number {
        font-size: 1.25rem !important;
    }
    
    .founder-stat .stat-label {
        font-size: 0.7rem !important;
    }
    
    .founder-message {
        padding-left: 0.5rem !important;
        font-size: 0.95rem !important;
    }
    
    .founder-qualifications {
        padding: 1rem !important;
        gap: 0.5rem !important;
    }
    
    .founder-vision {
        padding: 1rem !important;
    }
    
    .vision-points {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .legacy-timeline::before {
        left: 15px !important;
    }
    
    .timeline-item {
        margin-bottom: 1rem !important;
    }
    
    .timeline-year {
        width: 40px !important;
        height: 40px !important;
        font-size: 0.9rem !important;
        margin-right: 1rem !important;
    }
    
    .timeline-content {
        padding: 1rem !important;
    }
    
    .awards-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ===== INSTITUTIONS CAROUSEL RESPONSIVE ===== */
@media (max-width: 767px) {
    .institutions-section {
        padding: 2rem 0 !important;
    }
    
    .institution-with-carousel {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .institution-header {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center;
    }
    
    .institution-title-wrapper {
        min-width: 100% !important;
    }
    
    .institution-stats {
        justify-content: center;
        gap: 1rem !important;
    }
    
    .stat {
        font-size: 0.9rem !important;
    }
    
    .institution-description {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .swiper {
        height: 350px !important;
    }
    
    .slide-content h5 {
        font-size: 1rem !important;
    }
    
    .slide-content p {
        font-size: 0.85rem !important;
    }
    
    .carousel-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .carousel-nav-buttons {
        align-self: center;
    }
    
    .carousel-stats {
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 1rem !important;
        margin-top: 1rem !important;
    }
    
    .institution-footer {
        padding-top: 1rem !important;
    }
}

/* ===== BALIKASHRAM SECTION RESPONSIVE ===== */
@media (max-width: 767px) {
    .balikashram-section {
        padding: 2rem 0 !important;
    }
    
    .balikashram-card {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .card-image img {
        min-height: 300px !important;
    }
    
    .card-content {
        padding: 1.5rem !important;
    }
    
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .card-buttons .btn {
        width: 100%;
    }
    
    .csr-tag {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin-top: 0.5rem !important;
        display: inline-flex !important;
    }
}

/* ===== ABOUT SECTION RESPONSIVE ===== */
@media (max-width: 767px) {
    .about-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center;
    }
    
    .map-visual {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .state-card {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .approach-cards {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* ===== EDUCATION PREVIEW RESPONSIVE ===== */
@media (max-width: 767px) {
    .preview-cards {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .preview-card {
        padding: 1.5rem !important;
    }
}

/* ===== PROGRAMS PREVIEW RESPONSIVE ===== */
@media (max-width: 767px) {
    .programs-highlight {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .highlight-item {
        padding: 1rem !important;
    }
    
    .highlight-number {
        font-size: 2rem !important;
    }
}

/* ===== CONTACT SECTION RESPONSIVE ===== */
@media (max-width: 767px) {
    .contact-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .contact-card {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 1rem !important;
    }
    
    .contact-icon {
        margin: 0 auto !important;
    }
    
    .contact-form {
        padding: 1.5rem !important;
    }
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 767px) {
    .footer {
        padding: 2rem 0 1rem !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center;
    }
    
    .footer-logo .logo {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .footer-logo .logo-icon {
        width: 80px !important;
        height: 80px !important;
        margin: 0 auto !important;
    }
    
    .footer-logo .logo-fallback {
        font-size: 2rem !important;
    }
    
    .footer-logo .logo-title {
        font-size: 1.5rem !important;
    }
    
    .footer-logo .logo-subtitle {
        font-size: 1rem !important;
    }
    
    .footer-logo .logo-tagline {
        font-size: 0.9rem !important;
    }
    
    .footer-description {
        font-size: 1rem !important;
        padding-left: 0.75rem !important;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .newsletter-input {
        flex-direction: column;
        background: transparent;
    }
    
    .newsletter-input input {
        background: rgba(255, 255, 255, 0.1);
        margin-bottom: 0.5rem;
        border-radius: var(--radius-md);
    }
    
    .newsletter-input button {
        border-radius: var(--radius-md);
        padding: 0.75rem !important;
    }
    
    .footer-bottom {
        font-size: 0.9rem !important;
    }
}

/* ===== TABLET SPECIFIC ADJUSTMENTS ===== */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-content-wrapper {
        gap: 3rem !important;
    }
    
    .floating-cards-container {
        height: 400px !important;
    }
    
    .floating-card {
        width: 200px !important;
    }
    
    .balikashram-card {
        gap: 1.5rem !important;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .institution-with-carousel {
        padding: 1.5rem !important;
    }
    
    .swiper {
        height: 400px !important;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .footer-logo {
        grid-column: span 2;
    }
}

/* ===== LAPTOP/DEKSTOP FINE-TUNING ===== */
@media (min-width: 1200px) {
    /* Ensure desktop layouts are properly spaced */
    .hero-content {
        gap: 4rem !important;
    }
    
    .founder-content {
        gap: 4rem !important;
    }
    
    .contact-content {
        gap: 4rem !important;
    }
}

/* ===== VERY SMALL PHONES (iPhone 5/SE etc) ===== */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    .stat-number {
        font-size: 1.5rem !important;
    }
    
    .btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ===== FIX FOR IOS SAFARI ===== */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS 100vh issue */
    .education-hero-section,
    .hero {
        min-height: -webkit-fill-available;
    }
    
    /* Fix sticky hover on iOS */
    @media (hover: none) and (pointer: coarse) {
        .btn:hover,
        .nav-link:hover,
        .card:hover {
            transform: none !important;
        }
    }
}

/* ===== FIX FOR ANDROID CHROME ===== */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets for mobile */
    .btn,
    .nav-link,
    .carousel-nav,
    .indicator {
        min-height: 44px;
        min-width: 44px;
    }
    
    .stat-item,
    .feature,
    .vision-point {
        padding: 1rem !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .hero-scroll-indicator,
    .carousel-nav,
    .carousel-indicators,
    .carousel-controls,
    .social-links,
    .newsletter-input,
    .btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    section {
        page-break-inside: avoid;
        padding: 1rem 0 !important;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #121212;
        --dark: #ffffff;
        --gray: #cccccc;
        --gray-light: #1e1e1e;
        --gray-border: #333333;
    }
}