/* assets/css/responsive.css */

/* ===== EXTRA SMALL DEVICES (Phones, 600px and down) ===== */
@media only screen and (max-width: 600px) {
    
    /* Header */
    .top-bar {
        flex-direction: column !important;
        text-align: center !important;
        padding: 10px !important;
        height: auto !important;
    }
    
    .contact-info {
        justify-content: center !important;
        margin-bottom: 10px !important;
        flex-wrap: wrap !important;
    }
    
    .contact-item {
        font-size: 12px !important;
    }
    
    .quick-links {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    .quick-links a {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    
    .main-header {
        padding: 10px 0 !important;
    }
    
    .logo-container {
        width: 80px !important;
        height: 40px !important;
    }
    
    /* Navigation */
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-menu-button {
        display: flex !important;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 15px 10px !important;
    }
    
    .hero-content {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .carousel-container {
        height: 400px !important;
        min-height: 400px !important;
    }
    
    .carousel-slide {
        padding: 10px !important;
    }
    
    .carousel-content {
        padding: 15px !important;
    }
    
    .carousel-title {
        font-size: 1.2rem !important;
    }
    
    .carousel-subtitle {
        font-size: 0.8rem !important;
    }
    
    .carousel-btn {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }
    
    .carousel-control {
        width: 32px !important;
        height: 32px !important;
    }
    
    .carousel-indicator {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.5);
        cursor: pointer;
        padding: 0;
    }
    
    /* Section Padding */
    section {
        padding: 30px 15px !important;
    }
    
    .section-title {
        font-size: 1.3rem !important;
    }
    
    /* Cards */
    .cards-grid,
    .news-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .card {
        padding: 15px !important;
    }
    
    .card h3 {
        font-size: 1.1rem !important;
    }
    
    /* Tab Buttons */
    .tab-buttons {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .tab-button {
        width: 100% !important;
        padding: 10px !important;
        font-size: 0.9rem !important;
    }
    
    /* Forms */
    .form-row {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .form-group {
        width: 100% !important;
    }
    
    .form-control,
    .form-select {
        padding: 12px !important;
        font-size: 16px !important;
    }
    
    /* Buttons */
    .btn {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 1rem !important;
    }
    
    .action-buttons {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .action-buttons a,
    .action-buttons button {
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Modal */
    .modal-content {
        width: 95% !important;
        padding: 20px !important;
    }
    
    .modal-title {
        font-size: 1.3rem !important;
    }
    
    /* Footer */
    footer {
        padding: 30px 15px 15px !important;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .footer-section {
        text-align: center !important;
    }
    
    .footer-section h3 {
        font-size: 1.1rem !important;
    }
    
    .footer-links {
        align-items: center !important;
    }
    
    .campus-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .campus-item {
        text-align: center !important;
    }
    
    .footer-bottom {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center !important;
    }
    
    .legal-links {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    /* About Pages */
    .about-content {
        padding: 15px !important;
    }
    
    .about-section {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }
    
    /* Governance & Management */
    .member-card {
        padding: 20px !important;
    }
    
    .member-photo {
        width: 120px !important;
        height: 120px !important;
    }
    
    .member-name {
        font-size: 1.1rem !important;
    }
    
    .member-role {
        font-size: 0.9rem !important;
    }
    
    /* Programmes Pages */
    .programme-card {
        padding: 20px !important;
    }
    
    .programme-title {
        font-size: 1.2rem !important;
    }
    
    .tab-container {
        padding: 0 !important;
    }
    
    .tab-list {
        flex-direction: column !important;
        gap: 5px !important;
    }
    
    /* News & Events */
    .news-card {
        padding: 20px !important;
    }
    
    .news-image {
        height: 150px !important;
    }
    
    .news-title {
        font-size: 1.1rem !important;
    }
    
    .event-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .event-date {
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .gallery-item {
        height: 200px !important;
    }
    
    .category-filter {
        flex-wrap: wrap !important;
    }
    
    .category-btn {
        width: calc(50% - 5px) !important;
        text-align: center !important;
    }
    
    /* Documents Pages */
    .filter-section {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .filter-group {
        width: 100% !important;
    }
    
    /* Alumni Page */
    .alumni-form {
        padding: 20px !important;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Apply Page */
    .apply-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .info-box {
        padding: 15px !important;
    }
    
    .video-container {
        margin-bottom: 20px !important;
    }
    
    /* Contact Page */
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .contact-card {
        padding: 20px !important;
    }
    
    .campus-list {
        grid-template-columns: 1fr !important;
    }
}

/* ===== SMALL DEVICES (Portrait tablets and large phones, 601px to 768px) ===== */
@media only screen and (min-width: 601px) and (max-width: 768px) {
    
    .container,
    .container-wide {
        max-width: 600px !important;
    }
    
    .cards-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .hero-content {
        flex-direction: column !important;
    }
    
    .carousel-container {
        height: 500px !important;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .campus-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .apply-grid {
        grid-template-columns: 1fr !important;
    }
    
    .contact-grid {
        grid-template-columns: 1fr !important;
    }
    
    .category-btn {
        width: auto !important;
    }
}

/* ===== MEDIUM DEVICES (Landscape tablets, 769px to 992px) ===== */
@media only screen and (min-width: 769px) and (max-width: 992px) {
    
    .container,
    .container-wide {
        max-width: 900px !important;
    }
    
    .cards-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .campus-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .apply-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===== LARGE DEVICES (Laptops/Desktops, 993px to 1200px) ===== */
@media only screen and (min-width: 993px) and (max-width: 1200px) {
    
    .container,
    .container-wide {
        max-width: 1100px !important;
    }
    
    .cards-grid,
    .news-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ===== EXTRA LARGE DEVICES (Large Desktops, 1201px and up) ===== */
@media only screen and (min-width: 1201px) {
    
    .container {
        max-width: 1400px !important;
    }
    
    .container-wide {
        max-width: 1600px !important;
    }
}

/* Extra wide container for very large screens */
@media only screen and (min-width: 1600px) {
    .container-wide {
        max-width: 1800px !important;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    
    .nav-link,
    .dropdown-toggle,
    .btn,
    button,
    a,
    input[type="submit"],
    select,
    .tab-button,
    .category-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px !important;
    }
    
    .card:hover,
    .btn:hover,
    .nav-link:hover,
    .dropdown-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .card:active,
    .btn:active,
    .nav-link:active,
    .dropdown-item:active {
        opacity: 0.7;
    }
    
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    input,
    select,
    textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (orientation: landscape) and (max-height: 600px) {
    
    .hero-section {
        min-height: auto !important;
        padding: 20px !important;
    }
    
    .carousel-container {
        height: 400px !important;
    }
    
    .modal-content {
        max-height: 80vh !important;
        overflow-y: auto !important;
    }
    
    .mobile-nav {
        max-height: 100vh !important;
        overflow-y: auto !important;
    }
}

/* ===== FACEBOOK CARD RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .facebook-card {
        flex: none;
        height: 550px;
        width: 100%;
    }
    
    .facebook-header {
        padding: 12px 15px;
    }
    
    .facebook-icon {
        width: 18px;
        height: 18px;
    }
    
    .facebook-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .facebook-card {
        height: 500px;
    }
}

/* ===== RESPONSIVE TABLE TEXT TRANSFORMATION ===== */
@media (max-width: 768px) {
    table td,
    table td:before {
        font-size: 11px;
    }
    
    table td .btn,
    table td .action-button,
    table td button {
        text-transform: none;
    }
    
    .table-responsive + .table-responsive {
        margin-top: 20px;
    }
    
    .carousel-indicator {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    table td,
    table td:before {
        font-size: 10px;
    }
    
    .table-responsive {
        margin: 10px 0;
    }
}

/* Tablet specific table adjustments */
@media (min-width: 769px) and (max-width: 992px) {
    table td,
    table th {
        font-size: 10px;
    }
    
    td, th {
        padding: 12px 16px;
    }
}

/* Landscape orientation table handling */
@media (max-width: 768px) and (orientation: landscape) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
}

/* ===== UTILITY CLASSES FOR RESPONSIVE HIDING ===== */
.hide-mobile {
    display: block;
}

.hide-tablet {
    display: block;
}

.hide-desktop {
    display: none;
}

.show-mobile {
    display: none;
}

.show-tablet {
    display: none;
}

.show-desktop {
    display: block;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .hide-tablet {
        display: none !important;
    }
    
    .show-tablet {
        display: block !important;
    }
}

@media (min-width: 993px) {
    .hide-desktop {
        display: none !important;
    }
    
    .show-desktop {
        display: block !important;
    }
}

/* ===== FONT SIZE ADJUSTMENTS ===== */
.text-sm {
    font-size: 0.875rem !important;
}

.text-md {
    font-size: 1rem !important;
}

.text-lg {
    font-size: 1.125rem !important;
}

.text-xl {
    font-size: 1.25rem !important;
}

@media (max-width: 768px) {
    .text-sm {
        font-size: 0.8rem !important;
    }
    
    .text-md {
        font-size: 0.9rem !important;
    }
    
    .text-lg {
        font-size: 1rem !important;
    }
    
    .text-xl {
        font-size: 1.1rem !important;
    }
}

/* ===== SPACING ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .p-20 {
        padding: 15px !important;
    }
    
    .p-30 {
        padding: 20px !important;
    }
    
    .p-40 {
        padding: 25px !important;
    }
    
    .m-20 {
        margin: 15px !important;
    }
    
    .m-30 {
        margin: 20px !important;
    }
    
    .m-40 {
        margin: 25px !important;
    }
    
    .mt-20 {
        margin-top: 15px !important;
    }
    
    .mt-30 {
        margin-top: 20px !important;
    }
    
    .mt-40 {
        margin-top: 25px !important;
    }
    
    .mb-20 {
        margin-bottom: 15px !important;
    }
    
    .mb-30 {
        margin-bottom: 20px !important;
    }
    
    .mb-40 {
        margin-bottom: 25px !important;
    }
}

/* ===== GRID GAP ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .gap-20 {
        gap: 15px !important;
    }
    
    .gap-30 {
        gap: 20px !important;
    }
    
    .gap-40 {
        gap: 25px !important;
    }
}

/* ===== IMAGE RESPONSIVENESS ===== */
.responsive-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.img-circle {
    border-radius: 50%;
    object-fit: cover;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    
    body {
        background-color: white !important;
        color: black !important;
    }
    
    a, .btn {
        border: 2px solid currentColor !important;
    }
    
    .card {
        border: 2px solid #000 !important;
        box-shadow: none !important;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid #000 !important;
    }
    
    table {
        border: 2px solid #000 !important;
    }
    
    th, td {
        border: 1px solid #000 !important;
    }
    
    tbody tr:nth-child(even) {
        background-color: #f0f0f0;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    table {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    td {
        border-bottom-color: #333;
    }
    
    tbody tr:nth-child(even) {
        background-color: #252525;
    }
    
    tbody tr:hover {
        background-color: #2a2a2a;
    }
}

/* ===== REDUCED MOTION ===== */
@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;
    }
    
    .carousel-wrapper {
        transition: none !important;
    }
    
    .card:hover {
        transform: none !important;
    }
}

/* ===== CUSTOM SCROLLBAR FOR WEBKIT ===== */
@media (min-width: 769px) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 5px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #15803D;
        border-radius: 5px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #0e6c2d;
    }
}

/* ===== LOADING STATES ===== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== TOOLTIP FOR MOBILE ===== */
.tooltip {
    position: relative;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 5px 10px;
    border-radius: 4px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
}

@media (max-width: 768px) {
    .tooltip .tooltip-text {
        display: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    
    @page {
        margin: 2cm;
    }
    
    body {
        background-color: white !important;
        color: black !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }
    
    .no-print,
    header,
    footer,
    .breadcrumb,
    .btn,
    .tab-buttons,
    .filter-section,
    .action-buttons {
        display: none !important;
    }
    
    a {
        text-decoration: none !important;
        color: black !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        font-style: italic;
    }
    
    .container,
    .container-wide {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
}