/* Custom Bootstrap Theme - Methodist Church Colors (White and Light Blue) */
:root {
    --primary-blue: #0252A4;
    --light-blue: #d9ecff;
    --white: #ffffff;
    --text-dark: #1f2933;
    --border-color: #FEC301;
    --success: #2f9e44;
    --error: #DB3451;
}

/* Logo Styles */
.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-img-small {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.logo-img-sidebar {
    height: 80px;
    width: auto;
    object-fit: contain;
    max-width: 100%;
}

.logo-img-login {
    height: 100px;
    width: auto;
    object-fit: contain;
    max-width: 200px;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand .logo-img {
    flex-shrink: 0;
}

/* Responsive logo adjustments */
@media (max-width: 767.98px) {
    .logo-img {
        height: 40px;
    }
    
    .navbar-brand small {
        font-size: 0.75rem;
    }
}

/* Note: Update the color variables above based on colors extracted from the logo */
/* Common church logo colors might include: */
/* - Deep blues (#1e3a8a, #1e40af) */
/* - Gold/Yellow (#fbbf24, #f59e0b) */
/* - Red/Maroon (#991b1b, #7f1d1d) */
/* - Green (#065f46, #047857) */
/* Update --primary-blue, --light-blue, and other color variables as needed */

/* Override Bootstrap primary color */
:root {
    --bs-primary: #4a90e2;
    --bs-primary-rgb: 74, 144, 226;
}

.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

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

.bg-primary {
    background-color: var(--primary-blue) !important;
}

.text-primary {
    color: var(--primary-blue) !important;
}

.border-primary {
    border-color: var(--primary-blue) !important;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--light-blue);
    min-height: calc(100vh - 56px);
    padding-top: 1rem;
}

.sidebar .nav-link {
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
}

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

.sidebar .nav-link.active {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* Desktop: Show sidebar normally - override offcanvas behavior */
@media (min-width: 768px) {
    .sidebar.offcanvas {
        position: relative !important;
        visibility: visible !important;
        transform: none !important;
        z-index: auto !important;
        background-color: var(--light-blue) !important;
    }
    
    .sidebar.offcanvas-start {
        top: 0 !important;
        left: 0 !important;
        border-right: 1px solid var(--border-color);
        width: auto !important;
        max-width: none !important;
    }
    
    /* Prevent backdrop on desktop */
    .offcanvas-backdrop {
        display: none !important;
    }
}

/* Mobile: Use offcanvas */
@media (max-width: 767.98px) {
    .sidebar.offcanvas {
        position: fixed;
        top: 56px;
        bottom: 0;
        left: 0;
        z-index: 1045;
        max-width: 280px;
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
    }
    
    .sidebar.offcanvas.show {
        visibility: visible;
        transform: none;
    }
}

/* Navbar adjustments */
.navbar-brand {
    color: var(--primary-blue) !important;
}

.navbar-brand small {
    color: var(--text-dark);
    font-size: 0.875rem;
}

/* Card styles */
.card {
    border: 1px solid var(--border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header.bg-primary {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue);
}

/* Table responsive */
.table-responsive {
    border-radius: 0.375rem;
}

.table-hover tbody tr:hover {
    background-color: var(--light-blue);
}

/* Form styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.25rem rgba(74, 144, 226, 0.25);
}

/* Alert styles */
.alert-primary {
    background-color: var(--light-blue);
    border-color: var(--primary-blue);
    color: var(--text-dark);
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--success);
    color: #155724;
}

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

/* Badge styles */
.badge.bg-light {
    background-color: var(--light-blue) !important;
    color: var(--primary-blue) !important;
}

/* Footer */
footer {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
}

/* Login page specific */
body.d-flex {
    background-color: var(--light-blue);
}

/* Utility classes */
.bg-light-custom {
    background-color: var(--light-blue) !important;
}

/* System Settings Table Styles */
.subcategory-item {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.subcategory-item .badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.subcategory-item .badge .btn-link {
    text-decoration: none;
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.subcategory-item .badge .btn-link:hover {
    opacity: 0.7;
}

/* Responsive table for system settings */
@media (max-width: 768px) {
    .table-responsive table {
        font-size: 0.875rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem;
    }
    
    .subcategory-item {
        display: block;
        margin-bottom: 0.75rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    footer,
    .btn,
    .card-header {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
}
