/* Church Finance & Member Management System - Custom Styles */

:root {
    --primary-color: #081c31;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --sidebar-width: 250px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* User Profile Section Styles */
.user-profile-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    border-radius: 0 0 10px 10px 0;
    margin: 10px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.user-info {
    text-align: center;
    margin-top: 10px;
}

.user-info .fw-bold {
    color: white;
    font-size: 16px;
    margin-bottom: 5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.user-info small {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-details {
    margin-top: 15px;
    text-align: center;
}

.user-details .small {
    color: rgba(255,255,255,0.9);
    display: block;
    margin-bottom: 5px;
}

.user-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.user-actions .btn {
    border-radius: 20px;
    font-size: 11px;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.user-actions .btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.user-actions .btn-outline-light {
    color: white;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
}

.user-actions .btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.user-actions .btn-outline-danger {
    color: white;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
}

.user-actions .btn-outline-danger:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.user-details i {
    margin-right: 5px;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu .nav-link:hover,
.sidebar-menu .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--secondary-color);
}

.sidebar-menu .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Top Navigation */
.top-navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Content Area */
.content {
    padding: 30px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0, var(--secondary-color) 100%);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
    border: none;
}

/* Statistics Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary-color);
}

.stat-card.success::before { background: var(--success-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.danger::before { background: var(--danger-color); }
.stat-card.info::before { background: var(--info-color); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.stat-icon.primary { background: rgba(52, 152, 219, 0.1); color: var(--secondary-color); }
.stat-icon.success { background: rgba(39, 174, 96, 0.1); color: var(--success-color); }
.stat-icon.warning { background: rgba(243, 156, 18, 0.1); color: var(--warning-color); }
.stat-icon.danger { background: rgba(231, 76, 60, 0.1); color: var(--danger-color); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    padding: 10px 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0, #2980b9 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0, #229954 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0, #e67e22 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0, #c0392b 100%);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Form Styles */
.form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

/* Table Styles */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 15px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f1f1;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0, rgba(39, 174, 96, 0.05) 100%);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0, rgba(231, 76, 60, 0.05) 100%);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0, rgba(243, 156, 18, 0.05) 100%);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0, rgba(23, 162, 184, 0.05) 100%);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-body {
    padding: 40px 30px;
}

/* Badge Styles */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

/* Pagination Styles */
.pagination .page-link {
    border: none;
    color: var(--primary-color);
    padding: 10px 15px;
    margin: 0 2px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--secondary-color) 0, #2980b9 100%);
    color: white;
}

.pagination .page-link:hover {
    background: var(--light-color);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 20px;
    }
    
    .stat-card {
        margin-bottom: 20px;
    }
    
    .top-navbar {
        padding: 15px 20px;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Mobile navbar logo styling */
    .navbar-brand {
        font-size: 20px !important;
        font-weight: 600 !important;
        color: white !important;
        text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }
    
    .navbar-brand i {
        font-size: 18px;
        color: rgba(255,255,255,0.9);
    }
    
    .navbar-brand strong {
        color: white !important;
    }
    
    /* Sidebar adjustments */
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        height: 100vh;
        width: 250px;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .sidebar::-webkit-scrollbar {
        width: 6px;
    }
    
    .sidebar::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }
    
    .sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Main content adjustments — spacing via responsive-system.css + mobile nav */
    .main-content {
        margin-left: 0;
    }
    
    /* Mobile navigation */
    .navbar-brand {
        font-size: 18px !important;
    }
    
    .navbar .btn {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 15px;
        border-radius: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Table responsiveness */
    .table-responsive {
        margin-bottom: 15px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
        vertical-align: middle;
    }
    
    /* Form adjustments */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    /* Button adjustments — width handled in responsive-system.css */
    .content .btn {
        font-size: 1rem;
        padding: 0.65rem 1rem;
    }
    
    /* Input group adjustments */
    .input-group {
        margin-bottom: 15px;
    }
    
    .input-group-text {
        font-size: 14px;
        padding: 12px;
    }
    
    /* Alert adjustments */
    .alert {
        margin-bottom: 15px;
        padding: 12px;
        font-size: 14px;
    }
    
    /* Pagination adjustments */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination .page-link {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Dashboard cards */
    .stat-card {
        margin-bottom: 15px;
    }
    
    .stat-card .card-body {
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 24px;
    }
    
    .stat-card p {
        font-size: 14px;
    }
    
    /* Chart containers */
    .chart-container {
        height: 250px;
        margin: 15px 0;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    /* Breadcrumb adjustments */
    .breadcrumb {
        margin-bottom: 15px;
        font-size: 14px;
    }
    
    /* Badge adjustments */
    .badge {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    /* User profile section */
    .user-profile-section {
        margin: 5px;
        padding: 10px;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .user-info .fw-bold {
        font-size: 14px;
    }
    
    .user-info .small {
        font-size: 12px;
    }
    
    /* Sidebar menu items */
    .sidebar-menu {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding-bottom: 20px;
    }
    
    .sidebar-menu .nav-link {
        padding: 12px 20px;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .sidebar-menu .nav-link i {
        width: 20px;
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .sidebar-menu::-webkit-scrollbar {
        width: 4px;
    }
    
    .sidebar-menu::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .sidebar-menu::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }
    
    .sidebar-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.4);
    }
    
    /* Login page adjustments */
    .login-container {
        padding: 15px;
    }
    
    .login-card {
        max-width: 100%;
        margin: 0;
    }
    
    .login-header {
        padding: 20px;
    }
    
    .login-body {
        padding: 30px 20px;
    }
    
    /* Financial tables */
    .financial-table {
        font-size: 12px;
    }
    
    .financial-table th,
    .financial-table td {
        padding: 6px 4px;
    }
    
    /* Action buttons in tables */
    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
        margin: 1px;
    }
    
    /* Form rows */
    .row {
        margin-bottom: 10px;
    }
    
    .col-md-6,
    .col-md-4,
    .col-md-8,
    .col-md-12 {
        margin-bottom: 15px;
    }
    
    /* Text areas */
    textarea.form-control {
        min-height: 100px;
    }
    
    /* File inputs */
    input[type="file"] {
        font-size: 14px;
    }
    
    /* Date inputs */
    input[type="date"] {
        font-size: 16px;
    }
    
    /* Number inputs */
    input[type="number"] {
        font-size: 16px;
    }
    
    /* Search and filter forms */
    .search-form {
        margin-bottom: 15px;
    }
    
    .search-form .form-control {
        margin-bottom: 10px;
    }
    
    /* Summary cards */
    .summary-card {
        margin-bottom: 15px;
    }
    
    .summary-card .card-body {
        padding: 15px;
    }
    
    /* Recent items lists */
    .recent-item {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    .recent-item:last-child {
        border-bottom: none;
    }
    
    /* Footer adjustments */
    footer {
        text-align: center;
        padding: 20px 15px;
        font-size: 14px;
    }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
    .content {
        padding: 10px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .form-control,
    .form-select {
        padding: 10px;
        font-size: 14px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 6px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .stat-card h3 {
        font-size: 20px;
    }
    
    .stat-card p {
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--success-color);
    background: rgba(39, 174, 96, 0.1);
}

/* Modal Styles */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #f1f1f1;
}

.progress-bar {
    background: linear-gradient(135deg, var(--secondary-color) 0, #2980b9 100%);
    border-radius: 4px;
}

/* Tooltip Styles */
.tooltip {
    font-size: 12px;
}

.tooltip-inner {
    background: var(--primary-color);
    border-radius: 6px;
    padding: 8px 12px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* MOBILE SIDEBAR FIX */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
.sidebar.show + .sidebar-overlay {
    display: block;
}