/* Custom CSS for Fees Receipt Management System */

:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-bg: #f8f9fa;
    --border-radius: 12px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Navbar Styling */
.navbar {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.75rem 0;
    margin-bottom: 0;
}

.navbar.fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

/* Add padding to body when navbar is fixed */
body {
    padding-top: 0;
}

.fixed-top ~ .hero-section,
.fixed-top ~ .container,
.fixed-top ~ div {
    margin-top: 70px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    transition: transform var(--transition-speed);
}

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

.navbar-brand i {
    margin-right: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nav-link {
    margin: 0 5px;
    border-radius: 8px;
    transition: all var(--transition-speed);
    padding: 8px 16px !important;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: width var(--transition-speed);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.navbar-toggler {
    border: none;
    padding: 10px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Statistics Cards */
.stat-card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--box-shadow-hover);
}

.stat-card .card-subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.stat-card .card-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    opacity: 0.2;
    transition: all var(--transition-speed);
}

.stat-card:hover .stat-icon {
    opacity: 0.4;
    transform: rotate(10deg) scale(1.1);
}

/* Cards */
.card {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    transition: all var(--transition-speed);
    background: white;
}

.card:hover {
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border-bottom: 2px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #495057;
    padding: 1rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: all var(--transition-speed);
}

.table-hover tbody tr:hover {
    background-color: #f1f3f5;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badges */
.badge {
    padding: 0.5em 1em;
    font-weight: 500;
    border-radius: 20px;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all var(--transition-speed);
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition-speed);
    padding: 0.6rem 1.2rem;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(-1px);
}

.btn i {
    margin-right: 8px;
    transition: transform var(--transition-speed);
}

.btn:hover i {
    transform: scale(1.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Modal */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    border-bottom: 2px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #212529;
}

.modal-footer {
    border-top: 2px solid #e9ecef;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.btn-close {
    transition: transform var(--transition-speed);
}

.btn-close:hover {
    transform: rotate(90deg);
}

/* Forms */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed);
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    transform: translateY(-2px);
}

.form-control:hover, .form-select:hover {
    border-color: #dee2e6;
}

/* Search Box */
.input-group {
    box-shadow: var(--box-shadow);
    border-radius: 8px;
    transition: all var(--transition-speed);
    overflow: hidden;
}

.input-group-text {
    background-color: white;
    border-right: none;
    border: 2px solid #e9ecef;
    border-right: none;
    padding: 0.75rem 1rem;
}

.input-group .form-control {
    border-left: none;
    border: 2px solid #e9ecef;
    border-left: none;
}

.input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    transform: translateY(-2px);
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control {
    border-color: var(--primary-color);
}

/* Receipt Styling */
.receipt-print {
    background: white;
    padding: 30px;
    border: 2px solid #000;
}

.receipt-print .receipt-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.receipt-print .receipt-header h2 {
    margin: 0;
    font-weight: bold;
    color: #000;
}

.receipt-print .receipt-body {
    margin: 20px 0;
}

.receipt-print .receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #999;
}

.receipt-print .receipt-row strong {
    font-weight: 600;
}

.receipt-print .receipt-footer {
    margin-top: 40px;
    border-top: 2px solid #000;
    padding-top: 20px;
}

.receipt-print .signature-line {
    border-top: 2px solid #000;
    margin-top: 50px;
    padding-top: 10px;
    text-align: center;
}

/* Alert Styling */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: var(--box-shadow);
    animation: slideInDown 0.3s ease-out;
    border-left: 4px solid;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: #d1e7dd;
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: #f8d7da;
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: #fff3cd;
}

.alert-info {
    border-left-color: var(--info-color);
    background-color: #cff4fc;
}

/* List Group */
.list-group-item {
    border: 1px solid #dee2e6;
    transition: all var(--transition-speed);
    cursor: pointer;
    border-radius: 8px !important;
    margin-bottom: 8px;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
    transform: translateX(8px);
    box-shadow: var(--box-shadow);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Status Badges */
.status-active {
    background-color: #198754;
}

.status-inactive {
    background-color: #6c757d;
}

.status-pending {
    background-color: #ffc107;
    color: #000;
}

.status-overdue {
    background-color: #dc3545;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .receipt-print, .receipt-print * {
        visibility: visible;
    }
    
    .receipt-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
    }
    
    .modal-footer, .modal-header .btn-close {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card .card-title {
        font-size: 1.8rem;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 8px;
        width: 100%;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-top: 0;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .stat-card .card-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.card {
    animation: fadeIn 0.5s ease-out;
}

.stat-card {
    animation: fadeIn 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.stat-card:nth-child(2) { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.stat-card:nth-child(3) { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; }
.stat-card:nth-child(4) { animation-delay: 0.4s; opacity: 0; animation-fill-mode: forwards; }

.table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Success Message */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    box-shadow: var(--box-shadow-hover);
    border-radius: var(--border-radius);
}

.toast-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
    animation: fadeIn 0.5s ease-out;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.2;
    animation: pulse 2s infinite;
}

.empty-state h4 {
    margin-bottom: 15px;
    font-weight: 600;
    color: #495057;
}

.empty-state p {
    font-size: 1rem;
    color: #6c757d;
}

/* Pagination */
.pagination {
    margin-top: 20px;
}

.page-link {
    border-radius: 8px;
    margin: 0 4px;
    transition: all var(--transition-speed);
    border: 2px solid #dee2e6;
}

.page-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
}

.progress-bar {
    transition: width 0.6s ease;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
}

/* Tooltip Enhancement */
.tooltip-inner {
    background-color: #212529;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.875rem;
}

/* Smooth Transitions for Dynamic Content */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

/* Hover Effects for Interactivity */
.clickable {
    cursor: pointer;
    transition: all var(--transition-speed);
}

.clickable:hover {
    transform: scale(1.02);
}

/* Status Indicators with Animation */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.status-dot.active {
    background-color: var(--success-color);
}

.status-dot.inactive {
    background-color: var(--danger-color);
}

/* Container Enhancements */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Disabled State */
.btn:disabled,
.form-control:disabled,
.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Selection Color */
::selection {
    background-color: var(--primary-color);
    color: white;
}

/* Dropdown Enhancements */
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
    border: none;
    animation: slideInDown 0.2s ease-out;
}

.dropdown-item {
    transition: all var(--transition-speed);
    padding: 0.75rem 1.25rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

/* Grid Enhancements */
.row {
    margin-left: -10px;
    margin-right: -10px;
}

.row > * {
    padding-left: 10px;
    padding-right: 10px;
}

/* Flex Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Text Animations */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Fix spacing issues */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Page loader fixes */
.page-loader {
    position: fixed !important;
    margin: 0 !important;
    padding: 0 !important;
}
