/* ============================================
   CSS Variables & Root Styles
   ============================================ */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--light-bg);
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* ============================================
   Navbar Enhancements
   ============================================ */
.navbar {
    transition: all var(--transition-normal);
}

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

.navbar-brand:hover {
    transform: translateY(-2px);
}

.navbar-brand i {
    transition: transform var(--transition-normal);
}

.navbar-brand:hover i {
    transform: rotate(15deg) scale(1.1);
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: all var(--transition-fast);
    overflow: hidden;
}

.navbar .dropdown-toggle::after {
    visibility: hidden !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
}

.navbar .dropdown-toggle:hover::after {
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-link:not(.dropdown-toggle)::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: all var(--transition-normal);
    transform: translateX(-50%);
    border-radius: 3px 3px 0 0;
}

.nav-link:not(.dropdown-toggle):hover::before,
.nav-link:not(.dropdown-toggle).active::before {
    width: 80%;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.nav-link i {
    transition: transform var(--transition-fast);
}

.nav-link:hover i {
    transform: scale(1.2);
}

.dropdown-menu {
    animation: slideDown 0.3s ease;
    border: none !important;
    box-shadow: var(--shadow-lg);
}

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

.dropdown-item {
    padding: 0.75rem 0.75rem;
    transition: all var(--transition-fast);
    border-radius: 6px;
    margin: 0.25rem 0.25rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(13,110,253,0.1), rgba(11,94,215,0.15)); 
    color: var(--primary-color);
    transform: scale(0.9);
}

.dropdown-item i {
    transition: transform var(--transition-fast);
}

.avatar-wrapper {
    transition: all var(--transition-normal);
}

.avatar-wrapper:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13,110,253,0.5) !important;
}

.btn-outline-primary {
    border-width: 2px;
    transition: all var(--transition-normal);
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13,110,253,0.4);
}

.btn-primary {
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(13,110,253,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13,110,253,0.5);
}

/* Mobile menu animation */
@media (max-width: 991.98px) {
    .navbar-collapse {
        animation: fadeInDown 0.3s ease;
    }
    
    .nav-link::before {
        display: none;
    }
    
    .nav-item {
        animation: slideInRight 0.3s ease backwards;
    }
    
    .nav-item:nth-child(1) { animation-delay: 0.05s; }
    .nav-item:nth-child(2) { animation-delay: 0.1s; }
    .nav-item:nth-child(3) { animation-delay: 0.15s; }
    .nav-item:nth-child(4) { animation-delay: 0.2s; }
    .nav-item:nth-child(5) { animation-delay: 0.25s; }
    
    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   Footer Enhancements
   ============================================ */
.footer-modern {
    position: relative;
}

.footer-brand i {
    animation: float 3s ease-in-out infinite;
}

.social-icon {
    transition: all var(--transition-normal);
}

.social-icon:hover {
    background: var(--primary-color) !important;
    transform: translateY(-5px) rotate(360deg);
    box-shadow: 0 6px 16px rgba(13,110,253,0.6);
}

.footer-links a {
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover {
    opacity: 1 !important;
    color: var(--primary-color) !important;
    transform: translateX(5px);
}

.footer-links a i {
    transition: transform var(--transition-fast);
}

.footer-links a:hover i {
    transform: scale(1.3);
}

.contact-info a:hover {
    color: var(--primary-color) !important;
}

.hover-opacity-100:hover {
    opacity: 1 !important;
}

/* ============================================
   Hero Section with Parallax
   ============================================ */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, rgba(0,0,0,0.5), rgba(0,0,0,0.3)),
                url('../img/promo.jpg') no-repeat center/cover;
    color: white;
    padding: 120px 0 100px;
    text-shadow: 1px 2px 4px rgba(0,0,0,0.7);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    animation: fadeInDown 0.8s ease;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-section p {
    animation: fadeInUp 0.8s ease 0.2s both;
    font-size: 1.25rem;
}

.hero-section .btn {
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ============================================
   Trust Badges with Animation
   ============================================ */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: default;
}

.trust-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.trust-badge i {
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: transform var(--transition-fast);
}

.trust-badge:hover i {
    transform: rotate(360deg);
}

.trust-badge span {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============================================
   Step Cards with Hover Effects
   ============================================ */
.step-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

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

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

.step-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.step-number {
    width: 56px;
    height: 56px;
    line-height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    font-weight: 700;
    font-size: 1.5rem;
    display: inline-block;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(13,110,253,0.3);
    transition: all var(--transition-normal);
}

.step-card:hover .step-number {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(13,110,253,0.5);
}

/* ============================================
   Service Cards with Advanced Hover
   ============================================ */
.service-card {
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    background: var(--white);
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.service-card:hover::after {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.service-card .display-6 {
    transition: all var(--transition-normal);
}

.service-card:hover .display-6 {
    transform: scale(1.2) rotate(5deg);
    color: var(--primary-color);
}

/* ============================================
   Buttons with Enhanced Effects
   ============================================ */
.btn {
    border-radius: 50px;
    padding: 0.625rem 2rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.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;
    z-index: -1;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    box-shadow: 0 4px 15px rgba(13,110,253,0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(13,110,253,0.5);
}

.btn-outline-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(255,255,255,0.3);
}

/* ============================================
   Navigation Bar Enhancements
   ============================================ */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    transition: all var(--transition-normal);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    position: relative;
    transition: all var(--transition-fast);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
    transition: width var(--transition-normal);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* ============================================
   Branch Cards
   ============================================ */
.branch-card {
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--white);
    transition: all var(--transition-normal);
}

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

.branch-photo {
    height: 200px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.5s ease;
}

.branch-card:hover .branch-photo {
    transform: scale(1.1);
}

.branch-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.branch-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ============================================
   Forms
   ============================================ */
form p {
    margin-bottom: 1rem;
}

form label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-fast);
    font-size: 1rem;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13,110,253,0.1);
}

/* ============================================
   Dropdown Menus
   ============================================ */
.dropdown-menu-gray {
    background-color: #495057;
    border-color: #343a40;
    color: var(--white);
    box-shadow: var(--shadow-md);
    border-radius: 12px;
    animation: fadeInDown 0.3s ease;
}

.dropdown-menu-gray .dropdown-item {
    color: var(--white);
    transition: all var(--transition-fast);
    border-radius: 8px;
    margin: 0.25rem;
}

.dropdown-menu-gray .dropdown-item:hover,
.dropdown-menu-gray .dropdown-item:focus {
    background-color: #3b4147;
    color: var(--white);
    transform: translateX(5px);
}

.dropdown-menu-gray .dropdown-item.active,
.dropdown-menu-gray .dropdown-item:active {
    background-color: var(--primary-color);
    color: var(--white);
}

.dropdown-menu-gray .dropdown-divider {
    border-top-color: rgba(255,255,255,0.15);
}

/* ============================================
   Utility Classes
   ============================================ */
.min-vh-80 {
    min-height: 80vh;
}

.page-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: var(--white);
    padding: 2rem 0;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.page-header h2 {
    margin: 0;
    font-weight: 600;
    animation: slideInLeft 0.6s ease;
}

/* ============================================
   Loading Skeleton
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ============================================
   HTMX Loading States
   ============================================ */
.htmx-indicator {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

.htmx-swapping {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.htmx-settling {
    opacity: 1;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0 60px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .trust-badge {
        font-size: 0.85rem;
        padding: 0.625rem 1rem;
    }
    
    .step-number {
        width: 48px;
        height: 48px;
        line-height: 48px;
        font-size: 1.25rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar,
    footer,
    .btn {
        display: none;
    }
}