/* css/dept_responsive.css */

/* =========================================
   1. GLOBAL LAYOUT FIXES
   ========================================= */

/* Ensure main content wrapper is visible and clean */
.normal {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    background-color: #fff;
    position: relative;
    z-index: 10;
}

/* Fix for desktop container alignment */
#looken .container {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Scroll to Top Button Style */
#myBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: transparent;
    cursor: pointer;
    padding: 0;
}

/* =========================================
   2. BANNER IMAGE CENTERING (Desktop & Mobile)
   ========================================= */

/* PARENT: Force Flexbox Centering to fix "Right Shift" */
.kf_image_overlay {
    display: flex !important;
    justify-content: center !important; /* Horizontally Center */
    align-items: center !important;     /* Vertically Center */
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;             /* Remove any floats */
    background: #fff;                   /* Ensure clean background */
}

/* IMAGE: Restrict width and reset margins */
.kf_image_overlay img {
    display: block !important;
    width: auto !important;             /* Let max-width control the size */
    max-width: 80% !important;          /* 80% Width Constraint (User Request) */
    height: auto !important;
    margin: 0 auto !important;          /* Center the block element */
    box-shadow: none !important;        /* Remove unwanted shadows */
    border: none !important;
}

/* =========================================
   3. MOBILE & TABLET OPTIMIZATIONS (Max Width: 991px)
   ========================================= */

@media (max-width: 991px) {
    
    /* Layout & Visibility */
    .kf_inr_banner, 
    .normal {
        padding-left: 15px;
        padding-right: 15px;
    }

    #looken {
        padding-top: 20px;
    }

    /* Reduce the large top margin on mobile */
    .normal p[style*="margin-top: 67px"] {
        margin-top: 50px !important;
    }

    /* Force Text Color for Visibility */
    .normal p, 
    .tab-content p, 
    .tab-pane, 
    .kf_edu2_heading2 h3 {
        color: #333 !important;
    }

    /* Responsive Stacked Tabs */
    .fancyTabs {
        display: block;
        border-bottom: none;
        margin-bottom: 20px;
        padding: 0;
    }

    .fancyTabs > li {
        float: none;
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }

    .fancyTabs > li > a {
        display: block;
        padding: 12px 15px;
        background-color: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 4px;
        margin-right: 0;
        color: #495057;
        font-weight: 600;
        text-decoration: none;
    }

    .fancyTabs > li.active > a {
        background-color: #00bcd4; /* Theme Color */
        color: #fff;
        border-color: #00bcd4;
    }

    /* Tab Content Visibility */
    .tab-content {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        height: auto !important;
        padding: 0;
    }
    
    .tab-pane {
        display: none;
        opacity: 0;
    }
    
    .tab-pane.active {
        display: block;
        opacity: 1;
        animation: fadeIn 0.5s;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* --- MOBILE CARD VIEW FOR TABLES --- */
    .table-responsive {
        border: none;
        overflow: visible;
        margin-bottom: 0;
    }
    
    .table-responsive thead {
        display: none;
    }
    
    .table-responsive tr {
        display: block;
        margin-bottom: 20px;
        background-color: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        overflow: hidden;
    }
    
    .table-responsive td {
        display: block;
        text-align: right;
        padding: 12px 15px !important;
        position: relative;
        border: none;
        border-bottom: 1px solid #f1f1f1;
        font-size: 14px;
        min-height: 45px;
    }
    
    .table-responsive td:last-child {
        border-bottom: none;
    }
    
    .table-responsive td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
        font-size: 12px;
        color: #777;
        padding-top: 2px;
    }
    
    .table-responsive td[data-label="Name"] {
        background-color: #f9f9f9;
        font-weight: bold;
        color: #333;
        text-align: left;
    }
    .table-responsive td[data-label="Name"]:before {
        display: none;
    }
}