/* Custom styles for Influenced Decisions Dashboard */

/* Hover effects for cards */
.hover-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Selection summary styling */
#selection-summary {
    z-index: 100;
    position: relative;
}

#selection-summary .card-header {
    position: sticky;
    top: 0;
    z-index: 101;
}

/* Button spacing in button groups */
.btn-group .btn {
    margin-right: 0;
}

/* Ensure proper spacing for dashboard tiles */
.dashboard-tile {
    height: 100%;
    min-height: 200px;
}

/* Status badge sizing */
.badge.fs-6 {
    font-size: 0.9rem !important;
}

/* Form styling improvements */
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.075);
}

/* Modal improvements */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Card border improvements */
.card {
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 0.5rem;
}

/* Navbar brand styling */
.navbar-brand {
    font-weight: 600;
}

/* Dropdown menu styling and z-index fixes */
.navbar .dropdown-menu {
    z-index: 1050 !important;
    background-color: var(--bs-dark);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.15s ease-in-out;
}

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

.navbar .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.navbar .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Ensure navbar dropdowns are above everything */
.navbar {
    z-index: 1040;
}

.navbar .dropdown {
    z-index: 1050;
}

/* Selection sidebar should be below dropdowns */
.selection-sidebar {
    z-index: 100;
    position: relative;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.25rem !important;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Selection summary animations */
.list-unstyled li {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Dashboard stats cards */
.stats-card {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark) 100%);
    border: none;
    color: white;
}

.stats-card .card-body {
    padding: 2rem;
}

/* Service card improvements */
.service-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.125);
}

.service-card:hover {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
}

/* Bundle card styling */
.bundle-card {
    background: linear-gradient(135deg, rgba(var(--bs-warning-rgb), 0.1) 0%, rgba(var(--bs-warning-rgb), 0.05) 100%);
    border: 2px solid var(--bs-warning);
}

/* Profile form improvements */
.profile-section {
    margin-bottom: 2rem;
}

.profile-section:last-child {
    margin-bottom: 0;
}

/* Project status colors */
.project-status-not-started {
    background-color: var(--bs-secondary);
}

.project-status-in-progress {
    background-color: var(--bs-warning);
}

.project-status-completed {
    background-color: var(--bs-success);
}

.project-status-on-hold {
    background-color: var(--bs-info);
}

/* Admin panel improvements */
.admin-header {
    background: linear-gradient(135deg, var(--bs-dark) 0%, rgba(var(--bs-dark-rgb), 0.8) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
}

/* Quick action cards */
.quick-action-card {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.3s ease;
}

.quick-action-card:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

/* Estimate items display */
.estimate-items {
    max-height: 150px;
    overflow-y: auto;
}

.estimate-items::-webkit-scrollbar {
    width: 4px;
}

.estimate-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.estimate-items::-webkit-scrollbar-thumb {
    background: var(--bs-primary);
    border-radius: 2px;
}

/* Social media links */
.social-links a {
    transition: transform 0.2s ease;
}

.social-links a:hover {
    transform: scale(1.1);
}

/* Form validation styling */
.is-invalid {
    border-color: var(--bs-danger);
}

.invalid-feedback {
    display: block;
    color: var(--bs-danger);
}

/* Success states */
.is-valid {
    border-color: var(--bs-success);
}

.valid-feedback {
    display: block;
    color: var(--bs-success);
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .alert-dismissible .btn-close {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    .table {
        border-collapse: collapse;
    }
    
    .table th,
    .table td {
        border: 1px solid #000 !important;
    }
}

/* Dark theme enhancements */
[data-bs-theme="dark"] {
    --bs-body-color: #e9ecef;
    --bs-body-bg: #212529;
}

[data-bs-theme="dark"] .card {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--bs-dark);
    border-color: rgba(255, 255, 255, 0.125);
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .badge {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hover-card,
    .service-card,
    .social-links a,
    .quick-action-card {
        transition: none;
    }
    
    .list-unstyled li {
        animation: none;
    }
}
