/* AnchorPoint Custom Styles */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Body and Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    background-color: #f8f9fa;
    color: #212529;
}

/* Larger text throughout the system */
html {
    font-size: 17px;
}

p, span, label, td, th, li, a {
    font-size: 1rem;
    line-height: 1.6;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

.small, small {
    font-size: 0.9rem;
}

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

.btn {
    font-size: 1rem;
}

.table {
    font-size: 1rem;
}

.card-title {
    font-size: 1.15rem;
}

.card-text {
    font-size: 1rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Top Navigation Styling */
.navbar .nav-link {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.6rem 1.1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.navbar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar .dropdown-toggle::after {
    margin-left: 0.4rem;
    vertical-align: 0.15em;
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 200px;
    margin-top: 0.5rem;
    z-index: 10050 !important;
}

/* Ensure navbar stays on top of all content */
.navbar {
    z-index: 10040 !important;
    position: relative;
}

/* Fix all Bootstrap dropdowns to appear on top */
.dropdown-menu {
    z-index: 10050 !important;
}

.dropdown-menu.show {
    z-index: 10050 !important;
}

.navbar .dropdown-item {
    padding: 0.7rem 1.25rem;
    font-weight: 500;
    font-size: 1rem;
    color: #333;
    transition: all 0.15s ease;
}

.navbar .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.08);
    color: var(--primary-color);
}

.navbar .dropdown-item i {
    width: 1.25rem;
    text-align: center;
    color: #6c757d;
}

.navbar .dropdown-item:hover i {
    color: var(--primary-color);
}

.navbar .dropdown-divider {
    margin: 0.4rem 0;
    border-color: #e9ecef;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.2s ease-in-out;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

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

/* Resident Cards */
.resident-card {
    transition: all 0.2s ease-in-out;
}

.resident-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12);
}

/* Photo Styles */
.resident-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.resident-photo-lg {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

/* Badges */
.badge {
    font-size: 0.75em;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* Status Indicators */
.status-pending {
    color: var(--warning-color);
}

.status-approved {
    color: var(--success-color);
}

.status-denied, .status-rejected {
    color: var(--danger-color);
}

/* Navigation Tabs */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease-in-out;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 3px solid var(--primary-color);
    font-weight: 600;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: rgba(13, 110, 253, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

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

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-primary {
    border-left-color: var(--primary-color);
}

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

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

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

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

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem 0.75rem;
}

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

/* Login Page */
.min-vh-100 {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
}

.login-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
}

/* Dashboard Cards */
.dashboard-stat-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

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

/* Approval Status Icons */
.approval-status {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.approval-status i {
    margin-right: 0.25rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.25rem;
    top: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-nav {
        text-align: center;
    }
    
    .resident-photo,
    .resident-photo-lg {
        width: 50px;
        height: 50px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .nav-tabs,
    .btn,
    .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    body {
        background-color: #fff !important;
    }
}

/* Custom Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #146c43);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, var(--danger-color), #b02a37);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-up {
    animation: slideUp 0.3s ease-in-out;
}

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

/* Focus Indicators for Accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States */
.success-state {
    color: var(--success-color);
    background-color: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.2);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.error-state {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

/* TomSelect Dropdown Z-Index Fix */
.ts-wrapper {
    position: relative;
    z-index: 1000;
}

.ts-dropdown {
    z-index: 10000 !important;
    position: absolute !important;
}

.ts-dropdown-content {
    z-index: 10000 !important;
}

/* Ensure form groups don't clip dropdowns */
.form-group, .mb-3 {
    overflow: visible;
}

.card-body {
    overflow: visible;
}
