/* General body setup */
html, body {
    height: 100%; /* Ensure full viewport height */
    margin: 0;
}

/* Apply flexbox to body */
body {
    font-family: 'Arial', sans-serif;
    padding-top: 60px; /* To avoid content being hidden behind fixed navbar */
    display: flex;
    flex-direction: column;
    height: 100%; /* Full height of the screen */
    background-color: #eef0f2; /* Light gray for contrast */
}

/* Main content section should take remaining space */
.main-content {
    flex-grow: 1; /* Ensures it grows to fill available space */
}

/* Ensure submenu appears on hover */
.dropdown:hover .dropdown-menu {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: translateY(0); /* Smooth appear animation */
}

.dropdown-menu {
    display: none; /* Hide submenu by default */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px); /* Subtle transition effect */
    transition: visibility 0.2s, opacity 0.2s, transform 0.2s;
}

/* Hover functionality for larger screens */
@media (min-width: 992px) { 
    .dropdown:hover .dropdown-menu {
        display: block;
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }

    .dropdown-menu {
        display: none; /* Hide by default */
        visibility: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: visibility 0.2s, opacity 0.2s, transform 0.2s;
    }
}

/* Navbar Logo Size */
@media (max-width: 768px) {
    .navbar-brand img {
        width: 25px; /* Adjust size for smaller screens */
        height: 25px;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: bold;
}

.hero p {
    font-size: 1.2rem;
}

/* Features Section */
.features .icon-box {
    text-align: center;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background: #ffffff;
}

.features .icon-box i {
    font-size: 3rem;
    color: #2575fc;
    transition: color 0.3s;
}

.features .icon-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.features .icon-box:hover i {
    color: #1b5dbf;
}

/* Footer */
footer {
    background-color: #002b6a;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: auto; /* Ensures the footer is at the bottom of the screen */
}

footer a {
    color: #6a11cb;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: bold;
    color: #002b6a;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
}

.fc-daygrid-event-more {
    cursor: pointer;
    font-weight: bold;
    color: #007bff;
}

/* Maintenance */
.loader {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.image {
    max-width: 100%;
    height: auto;
    margin-bottom: 1em;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Form */
.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.form-label {
    font-weight: bold;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Ensure consistent border-radius */
.card {
    border: none;
    border-radius: 6px; /* Uniform radius for the entire card */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #ffffff;
    overflow: hidden; /* Prevent any overflow mismatch */
}

.card-header {
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 0; /* Remove individual radius */
    background-clip: padding-box; /* Ensure visual consistency */
}

.card-body {
    /* background-color: #f1f5f9; */
    padding: 20px;
    border-radius: 0; /* Remove individual radius */
}

.section-header {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #3f51b5;
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-container .canvas-container {
    background-color: #ffffff;
    border-radius: 6px;
    padding: 20px;
}

:root {
    --bs-dark-rgb: 0, 43, 106;
}

.bg-dark { 
    background-color: rgba(var(--bs-dark-rgb), 1) !important;
}

/* Ensure Select2 matches Bootstrap input styles */
.select2-container {
    width: 100% !important; /* Match Bootstrap input width */
}

/* Match Bootstrap's input height, padding, and borders */
.select2-container .select2-selection--single {
    height: calc(1.5em + .75rem + 2px) !important; /* Standard Bootstrap input height */
    padding: .375rem .75rem !important; /* Standard Bootstrap padding */
    border: 1px solid #ced4da !important; /* Bootstrap border color */
    border-radius: .375rem !important; /* Bootstrap rounded corners */
    background-color: #fff !important; /* Ensure consistent background */
    display: flex !important;
    align-items: center !important;
}

/* Ensure text is properly aligned */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.5em + .75rem) !important;
    padding-left: 0 !important; /* Remove extra left padding */
}

/* Ensure responsiveness */
@media (max-width: 768px) {
    .select2-container {
        width: 100% !important; /* Ensures it scales correctly on smaller screens */
    }
}

/* Set max height and enable scrolling for dropdown */
.select2-dropdown {
    max-height: 300px !important; /* Adjust height as needed */
    overflow-y: auto !important; /* Enable scrollbar */
}

/* Ensure the X (clear button) is properly aligned */
.select2-container--bootstrap-5 .select2-selection__clear {
    position: absolute;
    right: 8px; /* Adjust as needed */
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem; /* Adjust size to match other text */
    color: #6c757d; /* Match Bootstrap's muted text color */
    cursor: pointer;
}

/* Improve spacing inside the input box */
.select2-container--bootstrap-5 .select2-selection {
    padding-right: 30px !important; /* Space for clear button */
}

.chart-card .card-header {
    background-color: rgba(78, 121, 167, 1);
    color: white;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 60px;
    /* Ensure uniform height */
    display: flex;
    /* Flexbox for centering */
    align-items: center;
    /* Vertically center text */
    justify-content: center;
    /* Horizontally center text */
    padding: 0 10px;
    /* Prevent text from touching edges */
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-card .card-body {
    padding: 1rem;
    /* Add padding for spacing */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    /* Ensure charts have a uniform height */
}

/* Responsive Design for Small Screens */
@media (max-width: 768px) {
    .chart-card .card-header {
        font-size: 1rem;
        /* Reduce font size for smaller screens */
        min-height: 50px;
        /* Adjust height */
        padding: 5px 10px;
        /* Reduce padding */
    }
}

.card-flip {
    perspective: 1000px;
    width: 100%;
    height: 350px;
    position: relative;
    margin: auto;
    transition: transform 0.3s ease;
}

.card-flip:hover {
    transform: rotateX(2deg) rotateY(2deg);
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.25, 1.25, 0.5, 1.25);
}

.card-flip.flipped .card-inner,
.card-flip:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem 1.5rem;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    /* border: 2px solid transparent; */
    background-clip: padding-box;
}

/* FRONT STYLES */
.card-front {
    z-index: 2;
}

.card-blue {
    background: linear-gradient(135deg, #0070be, #3399ff);
    color: white;
    border-image: linear-gradient(135deg, #0070be, #3399ff) 1;
}

.card-green {
    background: linear-gradient(135deg, #33ac4b, #6dd47e);
    color: white;
    border-image: linear-gradient(135deg, #33ac4b, #6dd47e) 1;
}

.card-orange {
    background: linear-gradient(135deg, #ff8c00, #ffb347);
    color: white;
    border-image: linear-gradient(135deg, #ff8c00, #ffb347) 1;
}

/* BACK STYLES */
.card-back {
    transform: rotateY(180deg);
    color: white;
}

.card-blue-back {
    background: linear-gradient(135deg, #005a9c, #1a8cff);
    color: white;
    border-image: linear-gradient(135deg, #005a9c, #1a8cff) 1;
}

.card-green-back {
    background: linear-gradient(135deg, #2d8a3e, #58d68d);
    color: white;
    border-image: linear-gradient(135deg, #2d8a3e, #58d68d) 1;
}

.card-orange-back {
    background: linear-gradient(135deg, #cc7000, #ff9933);
    color: white;
    border-image: linear-gradient(135deg, #cc7000, #ff9933) 1;
}

/* ICONS + TEXT STYLING */
.card-front i,
.card-back i {
    margin-bottom: 1rem;
}

.card-front h4,
.card-back h4 {
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card-front p,
.card-back p {
    font-size: 0.95rem;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card-front p {
    color: #f0f0f0;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.card-text {
    font-size: 0.95rem;
    color: white;
}

/* BUTTONS */
.card-back .btn {
    margin-top: 1rem;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: bold;
    transition: 0.3s ease;
    border: 2px solid #fff;
}

.btn-blue {
    background-color: #ffffff;
    color: #0070be;
}

.btn-blue:hover {
    background-color: #0070be;
    color: white;
}

.btn-green {
    background-color: #ffffff;
    color: #33ac4b;
}

.btn-green:hover {
    background-color: #33ac4b;
    color: white;
}

.btn-orange {
    background-color: #ffffff;
    color: #ff8c00;
}

.btn-orange:hover {
    background-color: #ff8c00;
    color: white;
}

/* GLOW ON HOVER */
.card-blue:hover {
    box-shadow: 0 0 20px rgba(0, 112, 190, 0.5);
}

.card-green:hover {
    box-shadow: 0 0 20px rgba(51, 172, 75, 0.5);
}

.card-orange:hover {
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.5);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .card-flip {
        height: 300px;
    }
}

                .card {
                    border: none;
                    border-radius: 16px;
                    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
                }

                .dashboard-section { display: none; }

                .active-section { display: block; }

                .equal-height {
                    height: 100%;
                }

                @media (min-width: 992px) {
                    #mainChartCard {
                        height: calc(100% + 12px); /* adjust this value if needed */
                    }
                }
                                .card canvas {
                                    height: 180px !important;
                                    max-height: 180px;
                                }