/* Playful fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One:wght@400&family=Nunito:wght@300;400;600;700&display=swap'); /* School Portal Custom Styles */
:root {
    --bs-primary: #834240;
    --bs-secondary: #2d2323;
    --primary-color: #834240;
    --secondary-color: #2d2323;
    --accent-color: #45b7d1;
    --success-color: #96ceb4;
    --warning-color: #feca57;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --text-dark: #2c3e50;
}

/* Bootstrap overrides */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-primary:hover {
    background-color: #b6282d;
    border-color: #b6282d;
}

.btn-primary:active,
.btn-primary.active {
    background-color: #a02327;
    border-color: #a02327;
}

.btn-secondary {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

/* Outline button styles */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-outline-success {
    color: var(--success-color);
    border-color: var(--success-color);
}

.btn-outline-success:hover {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-outline-warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-outline-warning:hover {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-outline-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.btn-outline-danger:active,
.btn-outline-danger.active {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-outline-danger:disabled,
.btn-outline-danger.disabled {
    color: var(--danger-color);
    background-color: transparent;
    border-color: var(--danger-color);
    opacity: 0.65;
}

.btn-outline-info {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-outline-info:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Nav tabs custom styling */
.nav-tabs .nav-link.active.text-primary {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
}

.nav-tabs .nav-link:hover {
    border-color: var(--primary-color) !important;
}

body {
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 80px;
}

/* Homepage background animation */
body.homepage {
    position: relative;
    overflow-x: hidden;
}

body.homepage::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    animation: backgroundShuffle 30s infinite;
}

/* Dashboard body styling */
body.dashboard-body {
    background: #f8f9fa;
}

@keyframes backgroundShuffle {
    0%, 33% {
        background-image: url('../images/children-in-playground-lite.jpg');
        filter: brightness(1.1) contrast(1.1);
        transform: scale(1.05) rotate(0deg);
        background-position: 0 0;
    }
    16.5% {
        transform: scale(1.15) rotate(0deg);
        background-position: 50% 50%;
    }
    34%, 66% {
        background-image: url('../images/IMG-20230818-WA0028_1729979166.jpg');
        filter: sepia(0.3) saturate(1.2);
        transform: scale(1.1) rotate(1deg);
        background-position: 0 0;
    }
    50% {
        transform: scale(1.2) rotate(1deg);
        background-position: 100% 50%;
    }
    67%, 100% {
        background-image: url('../images/Nursery_1732550466.jpg');
        filter: hue-rotate(10deg) brightness(1.2);
        transform: scale(1.08) rotate(-1deg);
        background-position: 0 0;
    }
    83.5% {
        transform: scale(1.18) rotate(-1deg);
        background-position: 50% 100%;
    }
}

/* Header Styling */
.navbar {
    background: var(--primary-color);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    z-index: 1030;
}

.navbar-brand img {
    height: 50px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.1);
}

.navbar-toggler {
    border-color: white;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav .nav-link {
    color: white;
    font-weight: 600;
    margin: 0 10px;
    border-radius: 15px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: white;
    transform: translateY(-2px);
}

.navbar-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Homepage specific styles */
body.homepage {
    padding-bottom: 0;
}

body.homepage footer {
    position: sticky;
    bottom: 0;
}

.option-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Welcome Animation - Keep for backward compatibility */
.welcome-container {
    min-height: calc(80vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    /*padding: 20px;*/
}

.welcome-card {
    backdrop-filter: blur(10px);
    background-color: rgba(252, 255, 255, 0.5);
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-title {
    font-family: 'Fredoka One', cursive;
    /*color: var(--primary-color);*/
    font-size: 2.5rem;
    margin-bottom: 20px;
    animation: bounce 4s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.welcome-subtitle {
    /*color: var(--text-dark);*/
    font-size: 1.2rem;
    margin-bottom: 30px;
    animation: fadeIn 1s ease-in 0.5s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Account Type Selection */
.account-types {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.account-type-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border: none;
    border-radius: 20px;
    padding: 20px 30px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: fadeInScale 0.6s ease-out;
}

.account-type-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.account-type-btn.admin {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.account-type-btn.student {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Styling */
.modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.modal-title {
    font-family: 'Fredoka One', cursive;
}

.btn-close {
    filter: invert(1);
}

/* Form Styling */
.form-control,
.form-select {
    border-radius: 15px;
    border: 2px solid #e9ecef;
    padding: 12px 20px;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.form-select {
    height: calc(1.5em + 24px + 4px);
}

/*.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.25);
}*/

.btn-login {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 15px;
    padding: 12px 30px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Footer Styling */
footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    margin-top: auto;
    font-family: 'Nunito', sans-serif;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1020;
}

@media (min-width: 992px) {
    footer {
        left: 280px;
        width: calc(100% - 280px);
    }
}

footer p {
    margin: 2px 0;
    font-size: 0.75rem;
    line-height: 1.2;
}

footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #f8f9fa;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 2rem;
    }

    .account-types {
        flex-direction: row !important;
        align-items: center;
    }

    .account-type-btn {
        width: 100%;
        max-width: 300px;
    }

    .simple-welcome-container {
        padding: 5px;
        /*min-height: calc(100vh - 180px);*/
    }

    .welcome-content {
        margin: 0;
        padding: 15px 10px;
        width: 100%;
        max-width: none;
    }

    .logo {
        width: 100px;
        height: auto;
    }

    .welcome-title {
        font-size: 1rem;
        margin-bottom: 5px;
    }

    .welcome-subtitle {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }

    .text-center.mb-4 {
        margin-bottom: 1rem !important;
    }

    .option-card {
        padding: 15px 10px;
    }

    .option-card i {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .option-card h3 {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .option-card p {
        font-size: 0.75rem;
        margin: 0;
    }

    .login-options {
        gap: 10px;
    }

    .user-actions h2 {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    .simple-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .login-options {
        gap: 10px;
    }

    .option-card {
        min-width: auto;
        max-width: none;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .simple-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dashboard Styling */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 0;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.card-icon.student {
    background: var(--primary-color);
}

.card-icon.teacher {
    background: var(--secondary-color);
}

.card-icon.classes {
    background: var(--accent-color);
}

.card-icon.payments {
    background: var(--success-color);
}

.card-content h3 {
    margin: 0;
    font-size: 1rem;
    color: #666;
}

.card-number {
    margin: 5px 0 0 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 100px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 100px);
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
}

.sidebar.show {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    /*text-align: center;*/
    border-bottom: 1px solid #eee;
}

.sidebar-logo {
    width: auto;
    height: 50px;
    margin-bottom: 10px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-item.dropdown {
    flex-direction: column !important;
    align-items: flex-start !important;
}

.nav-item:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.nav-item i {
    width: 20px;
    margin-right: 15px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Adjust main content for sidebar */
/* Dropdown Menu Styling */
.dropdown-menu {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    min-width: 200px;
    width: auto;
    white-space: nowrap;
    overflow: hidden;
}

.dropdown-item {
    padding: 10px 20px;
    border-radius: 10px;
    margin: 2px 10px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.dropdown-divider {
    margin: 10px 15px;
    border-color: #eee;
}

/* Sidebar Dropdown Styling */
.dropdown-sidebar {
    display: block;
}

.nav-link-sidebar {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
}

.nav-link-sidebar:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.dropdown-sidebar {
    width: 100%;
    padding: 0;
    margin: 0;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.nav-link-sidebar[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Sidebar Toggle Arrow */
.sidebar-toggle-arrow {
    position: fixed;
    top: 40%;
    left: 0;
    z-index: 10000;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    width: 30px;
    height: 80px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    gap: 2px;
}

.sidebar-toggle-arrow:hover {
    background: var(--secondary-color);
    width: 35px;
}

.sidebar-toggle-arrow.sidebar-open {
    left: 280px;
}

.sidebar-toggle-arrow.sidebar-open i {
    transform: rotate(180deg);
}

.sidebar-text {
    font-size: 8px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Show toggle arrow on all screens */
.sidebar-toggle-arrow {
    display: flex;
}

/* Mobile dropdown menu fixes */
@media (max-width: 991px) {
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        margin-top: 10px;
    }

    .dropdown-item {
        color: white;
        padding: 8px 15px;
    }

    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }
}

/* Main content minimum height */
.page-content {
    min-height: 80vh;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    padding: 12px 25px 12px 50px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-sub-item:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.nav-sub-item i {
    width: 16px;
    margin-right: 12px;
}

@media (max-width: 991px) {
    .sidebar-toggle-arrow {
        display: flex;
    }
}

@media (min-width: 992px) {
    .sidebar {
        left: 0;
    }

    .page-wrapper {
        margin-left: 280px;
    }

    .sidebar-toggle-arrow {
        display: none;
    }
}

/* Remove underlines from all links */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Headings Primary Color */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color) !important;
}

/* Nested dropdown arrow rotation */
.nav-sub-item[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Active state for dropdown menu items */
.nav-sub-item.active {
    background: var(--primary-color) !important;
    color: white !important;
}

/* SweetAlert Toast Custom Colors */
.swal2-toast .swal2-title.toast-title {
    color: inherit !important;
}

.swal2-toast .swal2-html-container.toast-text {
    color: inherit !important;
}

/* Toast type specific colors */
.swal2-toast.swal2-icon-success .toast-title,
.swal2-toast.swal2-icon-success .toast-text {
    color: #28a745 !important;
}

.swal2-toast.swal2-icon-error .toast-title,
.swal2-toast.swal2-icon-error .toast-text {
    color: #dc3545 !important;
}

.swal2-toast.swal2-icon-warning .toast-title,
.swal2-toast.swal2-icon-warning .toast-text {
    color: #ffc107 !important;
}

.swal2-toast.swal2-icon-info .toast-title,
.swal2-toast.swal2-icon-info .toast-text {
    color: #17a2b8 !important;
}

/* Body Links Styling */
body a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

body a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Body Links Styling */
body a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

body a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Footer Links Override */
footer a {
    color: var(--warning-color) !important;
}

footer a:hover {
    color: #000 !important;
    text-decoration: none !important;
}

/* Sidebar Links Override */
.sidebar a,
.nav-item,
.nav-sub-item,
.nav-link-sidebar {
    text-decoration: none !important;
}

.sidebar a:hover,
.nav-item:hover,
.nav-sub-item:hover,
.nav-link-sidebar:hover {
    text-decoration: none !important;
}

/* Button Links Override */
.btn a,
button a {
    text-decoration: none !important;
}

.btn a:hover,
button a:hover,
.btn:hover {
    text-decoration: none !important;
}

/* Navigation Menu Links - Remove All Underlines */
.navbar-nav a,
.navbar-nav .nav-link,
.sidebar a,
.nav-item a,
.nav-sub-item a,
.nav-link-sidebar a,
.dropdown-menu a,
.dropdown-item {
    text-decoration: none !important;
}

.navbar-nav a:hover,
.navbar-nav .nav-link:hover,
.sidebar a:hover,
.nav-item a:hover,
.nav-sub-item a:hover,
.nav-link-sidebar a:hover,
.dropdown-menu a:hover,
.dropdown-item:hover {
    text-decoration: none !important;
}

/* Small dropdown menu items */
.dropdown-menu-sm {
    min-width: 160px;
}

.dropdown-item-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    line-height: 1.2;
}

.dropdown-item-sm i {
    font-size: 0.75rem;
    width: 14px;
}

/* Results Table Styling */
.results-table {
    margin-bottom: 0;
}

.results-table th,
.results-table td {
    vertical-align: middle;
    padding: 8px;
}

.results-table input[type="number"] {
    width: 80px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.results-table input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.1rem rgba(208, 47, 52, 0.25);
}

/* Mobile responsive tables */
@media (max-width: 767px) {
    .table-responsive {
        border: none;
    }

    .student-accordion-item {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    .student-accordion-header {
        background: #f8f9fa;
        padding: 15px;
        cursor: pointer;
        border-radius: 8px 8px 0 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .student-accordion-body {
        padding: 15px;
        display: none;
    }

    .student-accordion-body.show {
        display: block;
    }

    .subject-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

    .subject-row:last-child {
        border-bottom: none;
    }

    .subject-name {
        font-weight: 600;
        flex: 1;
    }

    .score-inputs {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .score-inputs input {
        width: 60px;
    }
}

/* Action button spacing */
.btn-group .btn {
    margin-right: 5px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.table .btn {
    margin-right: 5px;
}

.table .btn:last-child {
    margin-right: 0;
}

/* Search dropdown hover effect */
.hover-bg-light:hover {
    background-color: #f8f9fa !important;
}

/* Button height consistency with form controls */
.btn {
    padding: 12px 20px;
    height: calc(1.5em + 24px + 4px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive button font sizing */
@media (max-width: 576px) {
    .btn {
        font-size: 0.8rem;
        padding: 10px 16px;
        height: auto;
        min-height: calc(1.5em + 20px + 4px);
        white-space: normal;
        line-height: 1.2;
    }

    .btn-lg {
        font-size: 0.9rem;
        padding: 12px 18px;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .btn {
        font-size: 0.75rem;
        padding: 8px 12px;
    }

    .btn-lg {
        font-size: 0.8rem;
        padding: 10px 16px;
    }
}

@media (max-width: 360px) {
    .btn {
        font-size: 0.7rem;
        padding: 6px 10px;
    }

    .btn-lg {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

/* Thick borders between subjects in annual master list */
.border-end-thick {
    border-right: 3px solid #000 !important;
}

/* Colored thick border between sessions */
.border-end-session {
    border-right: 4px solid #d02f34 !important;
}

/* Thick border between subject groups */
.border-end-subject {
    border-right: 3px solid #d02f34 !important;
}

.sticky-left {
    position: sticky;
    left: 0;
    background-color: #fff;
    border-right: 2px solid #dee2e6;
    z-index: 10;
    min-width: 50px;
}

.sticky-left-name {
    position: sticky;
    left: 50px;
    background-color: #fff;
    border-right: 2px solid #dee2e6;
    z-index: 10;
    min-width: 150px;
}

.table-dark .sticky-left,
.table-dark .sticky-left-name {
    background-color: #212529;
}

.table-responsive {
    overflow-x: auto;
}

.help-modal .modal-body {
    max-height: 400px;
    overflow-y: auto;
}

.help-modal-body {
    color: #212529;
    line-height: 1.6;
}

.help-modal-body h6 {
    color: #0d6efd;
    font-weight: 600;
    margin-bottom: 15px;
}

.help-modal-body strong {
    color: #495057;
    font-weight: 600;
}

.help-modal-body .text-muted {
    color: #6c757d !important;
    font-size: 0.9em;
}

.help-modal-body .bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
}

.help-modal .modal-dialog {
    max-width: 600px;
}

/* Button text wrapping for very long text */
.btn-wrap {
    white-space: normal !important;
    word-wrap: break-word;
    text-align: center;
}

/* Global styling for block buttons */
.btn.d-block,
.btn.w-100 {
    margin-top: 1rem;
}

/* Remove top margin for first child block buttons */
.row > div:first-child .btn.d-block,
.row > div:first-child .btn.w-100,
.form-group:first-child .btn.d-block,
.form-group:first-child .btn.w-100 {
    margin-top: 0;
}

/* Specific handling for responsive block buttons */
.btn.d-block.d-md-inline-block,
.btn.w-100.d-md-inline-block,
.btn.d-block.d-lg-inline-block,
.btn.w-100.d-lg-inline-block {
    margin-top: 1rem;
}

/* Override margin for buttons with specific responsive classes */
@media (min-width: 768px) {
    .btn.d-md-inline-block {
        margin-top: 0;
    }
}

@media (min-width: 992px) {
    .btn.d-lg-inline-block {
        margin-top: 0;
    }
}

/* Livewire Loading Animation */
.livewire-loader {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 25px;
    padding: 15px 20px;
    backdrop-filter: blur(5px);
}

.loader-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.loader-dots .dot {
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.loader-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loader-dots .dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .livewire-loader {
        bottom: 15px;
        left: 15px;
        padding: 12px 16px;
    }

    .loader-dots .dot {
        width: 10px;
        height: 10px;
    }

    .loader-dots {
        gap: 6px;
    }

    /* Prevent center alignment of table headers on mobile */
    .card-header .btn,
    .card-header .btn-link,
    .card-header button {
        text-align: left !important;
        justify-content: flex-start !important;
    }

    .card-header .d-flex,
    .card-header .btn .d-flex {
        text-align: left !important;
        justify-content: space-between !important;
    }

    .card-header h6 {
        text-align: left !important;
    }

    /* Fix dropdown positioning in accordion headers */
    .card-header .dropdown-menu {
        z-index: 1050 !important;
    }

    /* Fix dropdown styling and positioning */
    .dropdown-menu {
        position: absolute !important;
        background-color: #fff !important;
        border: 1px solid rgba(0, 0, 0, .15) !important;
        border-radius: 0.375rem !important;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
        z-index: 1050 !important;
        min-width: 160px !important;
    }

    .dropdown-item {
        color: #212529 !important;
        background-color: transparent !important;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: #f8f9fa !important;
        color: #16181b !important;
    }

    .dropdown-item.text-danger {
        color: #dc3545 !important;
    }

    .dropdown-item.text-danger:hover {
        background-color: #f8d7da !important;
        color: #721c24 !important;
    }

    /* Hide accordion chevron arrows on all screen sizes */
    .accordion-button::after,
    .accordion-button:not(.collapsed)::after {
        display: none !important;
        content: none !important;
        background-image: none !important;
    }

    .accordion-button:focus {
        box-shadow: none !important;
    }

    /* Override Bootstrap accordion active background */
    .accordion-button:not(.collapsed) {
        background-color: transparent !important;
    }

    /* Mobile accordion improvements */
    .card-header [data-bs-toggle="collapse"] {
        transition: all 0.3s ease;
    }

    .card-header [data-bs-toggle="collapse"]:hover {
        background-color: rgba(0, 0, 0, 0.02);
    }

    /* Mobile status badges spacing */
    .d-md-none .badge {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 480px) {
    .livewire-loader {
        bottom: 10px;
        left: 10px;
        padding: 10px 14px;
    }

    .loader-dots .dot {
        width: 8px;
        height: 8px;
    }

    .loader-dots {
        gap: 5px;
    }
}

/* Global active button styling */
.btn:active,
.btn.active {
    background-color: rgba(208, 47, 52, 0.1) !important;
    border-color: rgba(208, 47, 52, 0.3) !important;
    color: var(--primary-color) !important;
}

/* Global disabled button styling */
.btn:disabled,
.btn.disabled {
    background-color: rgba(131, 66, 64, 0.1) !important;
    border-color: rgba(131, 66, 64, 0.3) !important;
    color: rgba(131, 66, 64, 0.6) !important;
}

#paymentsAccordion .accordion-item {
    margin-bottom: 0.75rem;
}

/* Responsive button sizing */
.btn-md-normal {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

@media (min-width: 768px) {
    .btn-md-normal {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
}

/* Animated chevron for mobile accordions */
.card-header [data-bs-toggle="collapse"] .fa-chevron-down {
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

.card-header [data-bs-toggle="collapse"][aria-expanded="true"] .fa-chevron-down,
.card-header [data-bs-toggle="collapse"]:not(.collapsed) .fa-chevron-down {
    transform: rotate(180deg);
}

.card-header [data-bs-toggle="collapse"].collapsed .fa-chevron-down {
    transform: rotate(0deg);
}

/* Global mobile font size reduction */
@media (max-width: 768px) {
    body {
        font-size: 0.875rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .form-control,
    .form-select {
        font-size: 0.875rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    h5 {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.8rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .form-control,
    .form-select {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    h4 {
        font-size: 1rem;
    }

    h5 {
        font-size: 0.9rem;
    }

    h6 {
        font-size: 0.85rem;
    }
}

/* Fixed subject column for by-student results form */
.subject-column {
    position: sticky;
    left: 0;
    background-color: #fff;
    border-right: 3px solid #000;
    box-shadow: 5px 0 10px rgba(0, 0, 0, 0.8);
    z-index: 10;
    min-width: 150px;
    font-weight: 600;
    vertical-align: middle;
}

/* Vertical alignment for all table cells in by-student form */
.table th,
.table td {
    vertical-align: middle;
}

.table-dark .subject-column {
    background-color: #212529;
}

/* Responsive text sizing for subject column */
@media (max-width: 768px) {
    .subject-column {
        font-size: 0.8rem;
        min-width: 120px;
        padding: 8px 6px;
    }
}

@media (max-width: 576px) {
    .subject-column {
        font-size: 0.75rem;
        min-width: 100px;
        padding: 6px 4px;
    }
}

@media (max-width: 480px) {
    .subject-column {
        font-size: 0.7rem;
        min-width: 90px;
        padding: 4px 3px;
    }
}


/* Master list mobile accordion horizontal lines */
@media (max-width: 991px) {
    .master-list-accordion .card {
        border-bottom: 2px solid #dee2e6;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .master-list-accordion .card:last-child {
        border-bottom: none;
    }
}

/* A4 Paper Width Constraints */
.a4-portrait-min {
    min-width: 794px; /* A4 portrait width at 96 DPI (210mm = 794px) */
}

.a4-landscape-min {
    min-width: 1123px; /* A4 landscape width at 96 DPI (297mm = 1123px) */
}

/* Result Modal Responsive Styling */
.result-modal .modal-dialog {
    max-width: 95vw;
}

@media (max-width: 767px) {
    .result-modal .modal-dialog {
        margin: 0;
        max-width: 100vw;
        max-height: 100vh;
    }

    .result-modal .modal-content {
        height: 100vh;
        border-radius: 0;
    }

    .result-modal .modal-body {
        overflow-y: auto;
        flex: 1;
    }

    .result-modal .modal-header,
    .result-modal .modal-footer {
        flex-shrink: 0;
    }
}


/* Modals */
body.dashboard-body .modal-backdrop:not(.note-modal-backdrop),
body.dashboard-body .modal:not(.note-modal) {
    z-index: 10109 !important;
}

/* Summernote Rich Text Editor Modals */
.note-modal,
.note-modal-backdrop,
.note-popover,
.note-dropdown-menu,
.note-color-palette,
.note-dialog {
    z-index: 10200 !important;
}

.note-modal h1,
.note-modal h2,
.note-modal h3,
.note-modal h4,
.note-modal h5,
.note-modal h6 {
    color: white !important;
}

.note-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-modal .close {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
}

.note-modal .close:hover {
    opacity: 1;
}
