/* ===== RESPONSIVE DESIGN ===== */

/* Tablet Styles */
@media (max-width: 1024px) {
    .why-choose-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .loan-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    
    /* Header */
    .header-top {
        padding: 0.75rem 0;
    }
    
    .logo-area {
        gap: 0.5rem;
    }
    
    .logo {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .institution-info h1 {
        font-size: 1.1rem;
    }
    
    .reg-number {
        font-size: 0.7rem;
    }
    
    .header-controls {
        gap: 0.75rem;
    }
    
    .font-controls {
        gap: 0.25rem;
    }
    
    .font-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    /* Hamburger Menu */
    .hamburger-menu {
        display: flex;
        margin-right: 0.5rem;
    }
    
    .hamburger-menu span {
        background: #E65F5F;
        width: 28px;
        height: 3px;
    }
    
    .hamburger-menu.active span {
        background: var(--accent);
    }
    
    /* Mobile Navigation */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 300px;
        height: 100vh;
        background: #1A3B5C;
        padding: 80px 1rem 2rem;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0;
        margin: 0;
    }
    
    .nav-menu > li {
        width: 100%;
        list-style: none;
    }
    
    .nav-menu > li > a {
        display: block;
        padding: 12px 16px;
        color: white;
        font-size: 1rem;
        font-weight: 500;
        text-decoration: none;
        border-radius: 8px;
    }
    
    /* Mega Dropdown Mobile */
    .mega-menu {
        display: none;
        padding: 1rem;
        margin-top: 0.5rem;
        background: #1A3B5C;
        width: 100%;
        border-radius: 12px;
        position: relative;
        z-index: 1001;
    }
    
    .mega-dropdown.active .mega-menu {
        display: block;
    }
    
    .mega-menu-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .mega-menu-col {
        width: 100%;
        padding: 0;
    }
    
    .mega-title {
        color: #FFFFFF;
        font-size: 1rem;
        font-weight: 600;
        display: inline-block;
        border-left: 3px solid #E65F5F;
        padding-left: 10px;
        margin-bottom: 0.3rem;
        text-decoration: none;
    }
    
    .mega-menu-col p {
        color: #B0C4DE;
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
        line-height: 1.3;
    }
    
    .mega-link {
        background: rgba(230, 95, 95, 0.2);
        color: #E65F5F;
        padding: 3px 10px;
        font-size: 0.7rem;
        border-radius: 20px;
        display: inline-block;
        text-decoration: none;
    }
    
    .btn-apply {
        background: #E65F5F;
        color: white;
        padding: 10px 20px;
        border-radius: 40px;
        text-align: center;
        display: inline-block;
        margin-top: 1rem;
    }
    
    /* Hero Section */
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .typing-text {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Section */
    .section {
        padding: 3rem 0;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    /* Floating Buttons */
    .floating-side-buttons {
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        gap: 8px;
    }
    
    .floating-btn {
        writing-mode: vertical-rl;
        padding: 10px 6px;
        min-height: 90px;
        font-size: 12px;
        border-radius: 8px 0 0 8px;
    }
    
    /* Badges */
    .badge {
        font-size: 0.75rem;
        padding: 6px 12px;
        display: inline-block;
        margin: 5px;
    }
    
    .btn-outline-full {
        padding: 0.6rem;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .glass-card {
        padding: 1.5rem !important;
    }
    
    .section h2 {
        font-size: 1.4rem;
    }
    
    /* FOOTER */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        text-align: left !important;
    }
    
    .footer-col {
        text-align: left !important;
        width: 100%;
    }
    
    .footer-col h3::after {
        left: 0 !important;
        transform: none !important;
    }
    
    .footer-links {
        text-align: left !important;
    }
    
    .footer-links li {
        text-align: left !important;
        margin-bottom: 0.5rem;
    }
    
    .footer-links.two-column {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .footer-contact li {
        justify-content: flex-start !important;
        text-align: left !important;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .footer-contact li i {
        flex-shrink: 0;
        margin-top: 0.2rem;
    }
    
    .footer-contact li span {
        flex: 1;
        word-wrap: break-word;
        white-space: normal;
    }
    
    .company-desc {
        text-align: left !important;
        word-wrap: break-word;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .footer-bottom-links .separator {
        display: none;
    }
    
    /* Text Wrapping */
    .container {
        padding: 0 1rem;
        overflow-x: hidden;
    }
    
    p, h1, h2, h3, h4, h5, h6, span, li, .footer-col, .company-desc {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }
    
    /* Contact Page */
    .contact-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }
    
    .contact-info-card {
        width: 100%;
        padding: 1.5rem;
    }
    
    .enquiry-form {
        width: 100%;
        padding: 1.5rem;
    }
    
    /* Contact Details */
    .contact-detail-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
        border-bottom: 1px solid #eee;
    }
    
    .contact-detail-item i {
        margin-bottom: 0.25rem;
    }
    
    .contact-detail-item div {
        width: 100%;
        word-wrap: break-word;
    }
    
    /* Map */
    .map-container iframe {
        width: 100%;
        height: 250px;
        border-radius: 12px;
    }
    
    /* Form Elements */
    input, select, textarea, button {
        font-size: 16px !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Admin Dashboard */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    th, td {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    /* WhatsApp Button */
    .whatsapp-float {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        z-index: 999;
    }
    
    .downloads-grid {
        grid-template-columns: 1fr;
    }
    
    .dropdown-menu {
        position: static;
        background: #1A3B5C;
        padding-left: 0;
        display: none;
        box-shadow: none;
        min-width: auto;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-toggle i {
        margin-left: 5px;
    }
    
        /* ===== ALL GRIDS STACK VERTICALLY ===== */
    .why-choose-grid,
    .loan-grid,
    .savings-grid,
    .rates-table,
    .leadership-grid,
    .management-grid,
    .about-mission-vision,
    .about-story-grid,
    .about-mission,
    .about-vision {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    /* ===== ALL CARDS FULL WIDTH ===== */
    .why-card,
    .loan-card,
    .savings-card,
    .leader-card,
    .management-card,
    .rate-box,
    .about-mission-vision .glass-card,
    .about-story-grid > div {
        width: 100% !important;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.6rem;
    }
    
    .typing-text {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .logo {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .institution-info h1 {
        font-size: 0.9rem;
    }
    
    .header-controls {
        gap: 0.5rem;
    }
    
    .font-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .floating-side-buttons {
        right: 0;
        gap: 6px;
    }
    
    .floating-btn {
        padding: 8px 5px;
        min-height: 75px;
        font-size: 11px;
    }
    
    .rate-box {
        padding: 0.8rem;
    }
    
    .badge {
        display: block;
        margin: 8px auto;
        width: fit-content;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .rate-row {
        padding: 8px 10px;
    }
    
    .rate-left span {
        font-size: 0.9rem;
    }
    
    .rate-right {
        font-size: 1rem;
    }
    
    .popup-contact .btn-group {
        flex-direction: column;
    }
    
    .legal-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .contact-detail-item {
        padding: 0.5rem;
    }
    
    .contact-detail-item i {
        font-size: 1rem;
    }
    
    .map-container iframe {
        height: 200px;
    }
    
    .footer-contact li span {
        font-size: 0.85rem;
    }
    /* About Page - Mobile Fix */
@media (max-width: 768px) {
    .about-story {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }
    
    .about-story > div:first-child {
        order: 1;
    }
    
    .about-story > div:last-child {
        order: 2;
    }
    
    .about-story img {
        width: 100% !important;
    }
    
    .about-mission-vision {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    .why-choose-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    .why-choose-grid .why-card {
        width: 100% !important;
    }
    
    .hero .stats-container {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
}
}