/* General Body Styles */
body {
    background-color: #f4f7f6;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    color: #333;
    transition: margin-left 0.3s;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    color: #ecf0f1;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar .navbar-brand {
    padding: 1rem 1.5rem;
    color: #fff;
    font-weight: bold;
    text-align: center;
    font-size: 1.5rem;
    flex-shrink: 0; /* Prevent brand from shrinking */
}

.menu-wrapper {
    flex-grow: 1; /* Takes up all available space */
    overflow-y: auto; /* Allows scrolling for menu items */
}

.sidebar .nav-link {
    padding: 12px 25px;
    text-decoration: none;
    font-size: 1rem;
    color: #bdc3c7;
    display: block;
    transition: all 0.3s ease;
}

.sidebar .nav-link i {
    margin-right: 15px;
    width: 20px; /* Align icons */
    text-align: center;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: #4a627a;
    color: #fff;
    border-left: 4px solid #3498db;
    padding-left: 21px;
}

.logout-wrapper {
    flex-shrink: 0; /* Prevents the logout area from shrinking */
    border-top: 1px solid #4a627a; /* Separator line */
}

.logout-wrapper .nav-link {
    font-weight: bold;
}

/* Content Area Styles */
.content {
    margin-left: 260px;
    padding: 30px;
    width: calc(100% - 260px);
    overflow-y: auto;
    transition: margin-left 0.3s ease;
}

/* Hamburger Menu Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #34495e;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1020; /* Ensure sidebar is on top */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        width: 100%;
        transition: filter 0.3s ease; /* Smooth transition for the filter */
    }

    .sidebar-toggle {
        display: block;
    }

    body.sidebar-active .content {
        /* Don't push content, but apply a visual effect */
        filter: blur(3px) brightness(0.6);
        pointer-events: none; /* Prevent interaction with content when sidebar is open */
    }

    /* The body itself gets an overlay to darken it */
    body.sidebar-active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 1010; /* Below sidebar, above content */
    }
}


h1, .h1 {
    color: #333 !important; /* Color oscuro para los títulos */
}


/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-title {
    margin: 0;
    font-size: 1.2rem;
}

/* Button Styles */
.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
    transition: background-color 0.3s;
}
.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-info {
    background-color: #1abc9c;
    border-color: #1abc9c;
}
.btn-info:hover {
    background-color: #16a085;
    border-color: #16a085;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}
.table {
    margin-bottom: 0;
    min-width: 600px; /* Prevent table from collapsing too much */
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom-width: 1px;
    font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

.badge {
    font-size: 0.85rem;
    padding: 0.5em 0.9em;
}

/* Form Styles */
.form-label {
    font-weight: 500;
}

.form-control, .form-select {
    border-radius: 5px;
}
.form-control:focus, .form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Payment Verification Status Styles */
.badge.estado-pago-pendiente {
    background-color: #fcf8e3 !important;
    color: #8a6d3b !important;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
}

.badge.estado-pago-verificado {
    background-color: #2E8B57 !important;
    color: #fff !important;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
}

.td-pago-verificado {
    background-color: #d4edda !important;
}

/* Style for the select element inside the badge */
.form-select-pago {
    background-color: transparent;
    border: none;
    color: inherit; /* Inherit text color from parent badge */
    font-weight: inherit; /* Inherit font weight */
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-select-pago:focus {
    box-shadow: none;
}

/* Make the select options have a standard background */
.form-select-pago option {
    background-color: #fff;
    color: #333;
}

/* Custom Search Table Styles */
.custom-search-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.custom-search-table thead th {
    background-color: #e9ecef; /* A light grey for the header */
    color: #495057;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #dee2e6;
}

.custom-search-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1; /* Light border for rows */
    color: #555;
}

.custom-search-table tbody tr:last-child td {
    border-bottom: none; /* No border for the last row */
}

.custom-search-table tbody tr:hover {
    background-color: #f8f9fa; /* Subtle hover effect */
}

/* Add rounded corners to the container of the table */
.table-responsive {
    border-radius: 8px;
    overflow: hidden; /* This is important to make border-radius work on tables */
    border: 1px solid #dee2e6;
}

/* Submenu Styles */
.sidebar .submenu {
    display: none;
    list-style: none;
    padding-left: 20px;
    background-color: #2c3e50;
}

/* Show submenu when it has .show class or its parent .has-submenu is active */
.sidebar .submenu.show,
.sidebar .nav-item.has-submenu.active > .submenu {
    display: block;
}

/* Keep the submenu open when the parent has the 'open' class (for JS toggle) */
.sidebar .nav-item.open > .submenu {
    display: block;
}

.sidebar .submenu .nav-link {
    padding-left: 35px;
    color: #bdc3c7; /* Match main link color */
}

/* Style for the active link within the submenu */
.sidebar .submenu .nav-link.active {
    color: #fff; /* White color for active sub-item */
    font-weight: bold;
}

@media (max-width: 767px) {
    .content {
        padding: 15px;
    }

    .card-header, .card-body {
        padding: 1rem;
    }

    h1, .h1 {
        font-size: 1.75rem;
    }

    .table {
        font-size: 0.9rem;
    }

    .table td, .table th {
        padding: 0.5rem;
    }
}