/* ================================
   RedBus Survey System - Main CSS
   UiTM Blue + RedBus Red Theme
================================ */

:root {
    --uitm-blue: #1b3a8a;
    --redbus-red: #c4161c;
    --light-gray: #f5f7fa;
    --dark-gray: #3d3d3d;
    --white: #ffffff;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 22px; 
    background-color: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.6;
}

/* ================================
   Typography
================================ */

.ls-tight { letter-spacing: -0.5px; }

/* Style for the secondary language */
.ms-text {
    display: block; /* Puts it on a new line for better readability */
    font-style: italic;
    color: #868c92; /* A professional muted grey */
    font-size: 1rem; /* Slightly smaller than the English text */
    margin-top: 4px;
}

/* Optional: Make the English text stand out */
.en-text {
    font-weight: 600;
    color: #212529;
}

/* Target all inputs and textareas */
::placeholder {
  color: #b9bdc1;    /* A soft, muted gray (Bootstrap's gray-500) */
  opacity: 0.7;      /* Makes it slightly transparent/faded */
  font-size: 0.85rem; /* Slightly smaller than the main text */
}

.text-uitm {
    color: var(--uitm-blue) !important;
}

.text-redbus {
    color: var(--redbus-red) !important;
}

/* ================================
   Navbar
================================ */
.navbar {
    background-color: var(--white);
    
    /* 1. The 3D Shadow Logic */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 
                0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* 2. Floating Box Styling */
    margin: 20px auto;        /* Creates space at top and centers it */
    width: 95%;               /* Gives it the "box" look by not touching edges */
    max-width: 1700px;        /* Matches your container-box feel */
    border-radius: 12px;
    padding: 15px 25px;
    border: 1px solid rgba(0,0,0,0.05); /* Subtle border for extra definition */

    /* 3. Static Behavior */
    position: relative;       /* Stays at the top, scrolls with the page */
    z-index: 1000;
}

.navbar .navbar-brand {
    color: var(--uitm-blue);
    font-size: 1.3rem;
    font-weight: bold;
}

.navbar .nav-link {
    color: var(--dark-gray);
    padding: 8px 15px !important;
    position: relative;
}

/* Modern underline effect for active/hover links */
.navbar .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 15px;
    background-color: var(--redbus-red);
    transition: width 0.3s ease;
}
.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: calc(100% - 30px);
}

.navbar .nav-link:hover {
    color: var(--redbus-red);
}

/* This targets the nav-link only when it has the .active class */
.navbar-nav .nav-link.active {
    color: var(--redbus-red) !important;
}

/* Optional: change the color when you hover over the active link */
.navbar-nav .nav-link.active:hover {
    color: var(--redbus-red) !important;
}

/* Mobile Tweak */
@media (max-width: 991px) {
    .nav-logo { height: 40px; }
    .navbar-nav { padding: 20px 0; }
    .navbar .nav-link::after { display: none; } /* Hide underline on mobile */
}

/* ================================
   Admin Dropdown
================================ */
/* Isolated Admin Style */
.admin-btn {
    display: inline-block;
    padding: 8px 15px;
    color: var(--dark-gray);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

/* Create the thin underline manually */
.admin-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 15px;
    background-color: var(--redbus-red);
    transition: width 0.3s ease;
}

/* Hover and Active states */
.admin-btn:hover, .admin-btn.active {
    color: var(--redbus-red) !important;
}

.admin-btn:hover::after, .admin-btn.active::after {
    width: calc(100% - 30px);
}

/* Stop the 'jumping' by forcing the menu to show on hover */
@media (min-width: 992px) {
    .admin-box:hover .dropdown-menu {
        display: block;
        margin-top: 0; /* Bridges the gap */
    }
}

/* Reset Bootstrap's dynamic positioning */
.admin-box .dropdown-menu {
    top: 100% !important;   /* Force it to start exactly below the link */
    right: 0 !important;     /* Align to the right edge */
    left: auto !important;
    margin-top: 10px !important; /* Fixed gap for both hover and click */
    transform: none !important;  /* Kill Bootstrap's 'jumping' transform */
}

/* Desktop Hover Trigger */
@media (min-width: 992px) {
    /* Show menu on hover */
    .admin-box:hover .dropdown-menu {
        display: block;
    }

    /* Create an invisible 'bridge' so hover doesn't break when moving mouse to menu */
    .admin-box::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 15px; /* Bridges the 10px margin gap */
        display: block;
    }
}

/* Keep the underline stable */
.admin-btn {
    display: block;
    padding: 8px 15px;
    position: relative;
    text-decoration: none;
}

/* Combined Hover, Active, and Focus states for the button */
.admin-btn:hover, 
.admin-btn.active, 
.admin-btn:focus, 
.admin-btn:active {
    color: var(--redbus-red) !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important; /* Removes the blue glow */
}

/* Ensure the red underline triggers for all click/hover states */
.admin-btn:hover::after, 
.admin-btn.active::after, 
.admin-btn:focus::after, 
.admin-btn:active::after {
    width: calc(100% - 30px) !important;
}

/* Fix for the internal menu items to prevent blue backgrounds */
.dropdown-item:active, 
.dropdown-item:focus {
    background-color: transparent !important;
    color: var(--redbus-red) !important;
}

/* Total Respondents and Back to Charts buttons */
/* This class makes the element lift and glow slightly */
.transition-hover {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth movement */
    display: inline-block;
}

.transition-hover:hover {
    transform: translateY(-8px); /* Moves it UP by 8 pixels */
    filter: brightness(1.1);      /* Makes the red color pop slightly */
    cursor: pointer;
}

/* ================================
   Buttons
================================ */
.btn-redbus {
    background-color: var(--redbus-red);
    color: var(--white);
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    transition: 0.3s;
}

.btn-redbus:hover {
    background-color: #a81015;
    color: var(--white);
}

.btn-outline-redbus {
    border: 2px solid var(--redbus-red);
    color: var(--redbus-red);
    background: transparent;
    padding: 8px 16px;
    border-radius: 6px;
}

.btn-outline-redbus:hover {
    background: var(--redbus-red);
    color: var(--white);
}

#btn-back-to-top {
    position: fixed;
    bottom: 30px;      /* Slightly higher from the bottom */
    right: 40px;       /* Moved further to the left from the edge */
    display: none; 
    width: 60px;       /* Increased size from 45px */
    height: 60px;      /* Increased size from 45px */
    border-radius: 50%;
    z-index: 1000;
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3); /* Slightly deeper shadow for the larger size */
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: none;
    
    /* Center the icon perfectly */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;   /* Makes the arrow icon bigger */
}

#btn-back-to-top:hover {
    transform: scale(1.1);
    background-color: var(--redbus-red);
    color: white;
}

/* Button greyed out state */
.btn-redbus:disabled {
    background-color: #d1d1d1 !important;
    border-color: #b5b5b5 !important;
    color: #7a7a7a !important;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Styling for the popup */
.tooltip-inner {
    background-color: var(--redbus-red) !important;
    font-weight: 600;
}

.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--redbus-red) !important;
}

/* Mobile adjustment */
@media (max-width: 768px) {
    #btn-back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

/* ================================
   Page Layout
================================ */
.container-box {
    background: var(--white);
    padding: 30px;
    margin: 40px auto;
    border-radius: 10px;
    max-width: 1000px;
    box-shadow: 0px 0px 20px rgba(0,0,0,0.08);
}

.rounded-4 { border-radius: 1.25rem !important; }

.accent-line {
    width: 60px;
    height: 4px;
    background-color: var(--redbus-red);
    border-radius: 2px;
}

/* ================================
   Headings
================================ */
h1, h2, h3 {
    color: var(--uitm-blue);
    margin-bottom: 15px;
}

.section-title {
    border-left: 5px solid var(--redbus-red);
    padding-left: 10px;
    margin-bottom: 20px;
}

.lh-lg {
    line-height: 1.8 !important;
    text-align: justify; /* Makes academic text look more formal */
}

/* ================================
   Survey Form
================================ */

/* Likert Scale Custom Styling */
.likert-scale {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.likert-item {
    flex: 1;
    cursor: pointer;
}

.likert-item input {
    display: none; /* Hide original radio */
}

.likert-box {
    display: block;
    background: white;
    border: 2px solid #ddd;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s ease;
}

/* Hover and Checked states */
.likert-item:hover .likert-box {
    border-color: var(--redbus-red);
    background: #fff5f5;
}

.likert-item input:checked + .likert-box {
    background-color: var(--redbus-red);
    border-color: var(--redbus-red);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(196, 22, 28, 0.3);
}

/* Survey Tabs Enhancements */
#surveyTabs .nav-link {
    color: var(--uitm-blue);
    border-radius: 6px;
    font-weight: 600;
    border: none;
    background: none;
}

#surveyTabs .nav-link.active {
    background-color: var(--white) !important;
    color: var(--uitm-blue) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Ensure the badge is visible */
.badge-redbus {
    background-color: #d32f2f !important; /* Adjust to your exact RedBus hex code */
    color: white !important;
    padding: 0.5em 0.8em;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ================================
   Input Fields
================================ */
input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-top: 5px;
}

input:focus, select:focus {
    border-color: var(--uitm-blue);
    outline: none;
}

/* Fix for input group alignment */
.input-group > .form-control {
    margin-top: 0 !important; /* Removes the 5px margin that pushes the box down */
}

.input-group > .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure the input-group-lg height is uniform */
.form-control-lg {
    height: calc(1.5em + 1rem + 4px); /* Forces exact height match with the button */
}

/* ================================
   Status Page
================================ */
.status-box {
    text-align: center;
    padding: 30px;
}

.status-success {
    color: green;
    font-weight: bold;
}

.status-pending {
    color: orange;
    font-weight: bold;
}

/* Update these in main.css */
.input-group .form-control:focus {
    z-index: 3;
    border-color: var(--redbus-red);
    box-shadow: none;
}

.badge {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* ================================
   Footer
================================ */
.footer {
    background-color: var(--uitm-blue);
    color: var(--white);
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

/* ================================
   Hero Section
================================ */
/* --- Hero Section Core --- */
.hero-section {
    position: relative;
    overflow: hidden;
}

/* Enhances readability of the long title */
.hero-title {
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); /* Critical for long text on images */
    line-height: 1.2;
    max-width: 1300px; /* Prevents text from stretching too wide on big screens */
    margin-left: auto;
    margin-right: auto;
}

/* Styling for the "(redBus)" or specific highlights */
.hero-highlight {
    color: var(--redbus-red); /* Gold/Yellow pops best against dark backgrounds */
    font-style: normal;
}

/* The subheading text */
.hero-lead {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1.1rem;
}

/* Subtle shadow for better readability over the banner */
.hero-title-shadow {text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7); }

/* --- Animation for the Hero Content --- */
.fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Team Section
================================ */

.team-card {
    transition: all 0.3s ease;
}

.team-card:hover {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.team-circle {
    width: 120px; /* Slightly bigger looks better with photos */
    height: 120px;
    border-radius: 50%;
    background-color: #e9ecef;
    border: 3px solid #fff;
    overflow: hidden; /* This crops the image into a circle */
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This is the "magic" property that prevents stretching */
    object-position: center;
}

/* ================================
   Mobile Friendly
================================ */
@media (max-width: 768px) {
    .container-box {
        margin: 20px;
        padding: 20px;
    }

    .likert-scale {
        flex-direction: column;
        align-items: flex-start;
    }

    .likert-scale label {
        margin-bottom: 5px;
    }
}

/* ================================
   AHP Section
================================ */

/* Adjust the size of the circles and the numbers */
.ahp-box {
    width: 40px;          /* Change this to adjust circle size */
    height: 40px;         /* Must match width for a perfect circle */
    font-size: 18px;      /* Change this to adjust number size */
    
    display: inline-flex; /* Keeps them in a row and centers numbers */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: 0.2s;
}

/* Optional: Make the selected one turn RedBus Red */
.ahp-item input:checked + .ahp-box {
    background-color: #e31837;
    border-color: #e31837;
    color: white;
}

/* Hide the actual tiny browser radio button */
.ahp-item input {
    display: none;
}

/* ================================
   Cards
================================ */

/* --- Feature Cards (Survey Boxes) --- */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-color: #eee !important;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1) !important;
    border-color: var(--redbus-red) !important;
}

.feature-card .icon-circle i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Contact Banner --- */
.contact-banner {
    background: var(--white);
    border: 1px solid #eee;
}

.contact-pill {
    background: var(--light-gray);
    padding: 10px 20px;
    border-radius: 50px;
    display: inline-block;
    color: var(--uitm-blue);
}

/* ================================
   Modal
================================ */
/* Modal Overlay - Darkens background */
.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    cursor: pointer; /* Suggests clicking background closes it */
}

/* Modal Content Box */
.custom-modal-content {
    background: #fff;
    max-width: 550px;
    width: 90%;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.2s ease;
    cursor: pointer; /* Hovering anywhere on card shows pointer */
}

.custom-modal-content:hover .dismiss-hint {
    color: #dc3545 !important; /* Changes text to redbus color to prompt closing */
}

/* When active */
.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.custom-modal-overlay.active .custom-modal-content {
    transform: translateY(0);
}

/* Icon Styling */
.modal-icon {
    width: 60px; height: 60px;
    background-color: #f8f9fa; color: #dc3545; /* Redbus Red */
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    margin: 0 auto; font-size: 1.8rem;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    background: none; border: none;
    font-size: 1.5rem; color: #adb5bd;
    cursor: pointer;
}