/* California Legal Helper - Custom Styles */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
}

/* Pulse Animation for Tax Calculator Button */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.pulse-animation:hover {
    animation: none;
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Tax Calculator Button Styles */
.tax-calculator-btn {
    font-weight: 600;
    border: 2px solid #fbbf24;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
}

.tax-calculator-btn:hover {
    background: linear-gradient(45deg, #f59e0b, #d97706);
    border-color: #d97706;
}

/* Browse Categories Button Styles */
.browse-categories-btn {
    font-weight: 600;
    border: 2px solid #e5e7eb;
    background: linear-gradient(45deg, #ffffff, #f8fafc);
    color: #374151;
}

.browse-categories-btn:hover {
    background: linear-gradient(45deg, #f8fafc, #e5e7eb);
    border-color: #d1d5db;
    color: #111827;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .hero-section .col-lg-8 {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .hero-section .fa-balance-scale {
        margin-top: 1rem;
        opacity: 0.5;
    }
    
    /* Improve spacing for mobile navigation */
    .navbar .d-flex.me-3 {
        margin-bottom: 0.5rem;
    }
    
    .tax-calculator-btn {
        white-space: nowrap;
    }
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #ffffff;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 1rem 0;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.hover-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Category Icons */
.category-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Clickable Category Cards */
.category-card-clickable {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.category-card-clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

/* Ensure card contents remain properly styled when wrapped in a link */
a.text-decoration-none .card-title {
    color: inherit !important;
}

a.text-decoration-none:hover .card-title {
    color: var(--primary-color) !important;
}

/* FAQ Styles */
.faq-card {
    transition: all 0.3s ease;
}

.faq-question {
    color: var(--primary-color) !important;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--secondary-color) !important;
    text-decoration: underline !important;
}

.faq-preview {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.useful-links-preview {
    background-color: var(--light-bg);
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

/* Advertisement Placeholders */
.ad-placeholder {
    margin: 1rem 0;
}

.ad-placeholder .bg-light,
.ad-placeholder .bg-secondary {
    border: 2px dashed #dee2e6;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.ad-banner-header {
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-ad {
    position: sticky;
    top: 120px;
    z-index: 999;
}

.anchor-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: 0 -0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
}

/* Search */
.search-highlight {
    background-color: #fef3c7;
    padding: 0.1rem 0.2rem;
    border-radius: 0.25rem;
}

/* Glossary */
.glossary-term {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.glossary-term:last-child {
    border-bottom: none;
}

.glossary-nav {
    background-color: var(--light-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.glossary-nav .btn {
    margin: 0.25rem;
    min-width: 40px;
}

/* Category Header */
.category-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
}

/* Alerts and Messages */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Footer */
footer {
    background-color: #1f2937 !important;
}

footer a {
    color: #d1d5db !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
    text-decoration: underline;
}

footer h5, footer h6 {
    color: #f9fafb !important;
    font-weight: 600;
}

footer .text-muted {
    color: #9ca3af !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .sidebar-ad {
        display: none;
    }
    
    .category-icon {
        height: 60px;
    }
    
    .faq-preview {
        margin-left: 0;
        border-left: none;
        border-top: 3px solid var(--primary-color);
        padding-left: 0;
        padding-top: 1rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .category-header {
        padding: 2rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .ad-placeholder,
    .sidebar-ad,
    .anchor-ad,
    footer,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}

/* Accessibility */
.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 Styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

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

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Utility Classes */
.text-primary-custom {
    color: var(--primary-color) !important;
}

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

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

.shadow-custom {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1) !important;
}

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

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

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

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