/* LegalAI Custom Styles */

/* Base styles and typography */
body {
    font-family: 'Nunito', sans-serif;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .brand-text {
    font-weight: 700;
}

.text-light-emphasis {
    opacity: 0.85;
}

/* Navigation styling */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #3380c9 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
}

.navbar {
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-icon-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0 0.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: normal;
    text-align: left;
    min-height: 48px;
    line-height: 1.2;
    flex-wrap: wrap;
}

.nav-icon-link:hover, .nav-icon-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.15);
    margin-right: 8px;
    flex-shrink: 0;
}

/* Document preview styles */
#document-preview {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.5;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--bs-gray-600);
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#document-preview:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

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

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    left: 9px;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom, var(--bs-primary), var(--bs-info));
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(5px);
}

.timeline-item-marker {
    position: absolute;
    left: -2rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-item-marker-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: bold;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-item-marker-number {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timeline-item-content {
    padding-bottom: 0.75rem;
    padding-left: 1.5rem;
}

/* Card styles */
.card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

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

.card-header {
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    border-top: none;
    background-color: transparent;
}

/* Feature icons styling */
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1) 0%, rgba(var(--bs-info-rgb), 0.1) 100%);
    color: var(--bs-primary);
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}

.feature-icon:hover {
    transform: scale(1.05) rotate(5deg);
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.15) 0%, rgba(var(--bs-info-rgb), 0.15) 100%);
    color: var(--bs-info);
}

/* Button styling */
.btn {
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary, .btn-info {
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.3);
}

.btn-primary:hover, .btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--bs-primary-rgb), 0.4);
}

.btn-outline-light {
    border-width: 2px;
}

.btn-outline-light:hover {
    transform: translateY(-2px);
}

/* Footer styling */
.footer {
    position: relative;
}

.footer-heading {
    position: relative;
    display: inline-block;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
}

.footer-heading:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 40px;
    background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-info) 100%);
    border-radius: 3px;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.footer-link:hover {
    color: var(--bs-primary);
    transform: translateX(3px);
}

.footer-contact, .footer-testimonial {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
}

.footer-contact-icon, .footer-testimonial-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
    color: white;
    flex-shrink: 0;
}

.footer-quote {
    font-style: italic;
    opacity: 0.85;
}

/* Print styles */
@media print {
    nav, footer, .btn, form, .alert-warning, .card-header, .card-footer {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000 !important;
        background-color: #fff !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    .card-body {
        padding: 0 !important;
    }
    
    h1 {
        font-size: 18pt;
        margin-bottom: 20px;
    }
    
    h2, h3, h4, h5 {
        font-size: 14pt;
        margin-top: 20px;
        margin-bottom: 10px;
    }
    
    p, li {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: none !important;
        color: #000 !important;
    }
    
    #document-preview {
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
    }
}

/* Custom styles for code blocks */
.code-block {
    background-color: var(--bs-gray-800);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    font-family: monospace;
    white-space: pre-wrap;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

/* Custom styles for legal citations */
.legal-citation {
    font-style: italic;
    color: var(--bs-info);
    border-bottom: 1px dotted var(--bs-info);
    display: inline-block;
}

/* Custom form styles */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.625rem 1rem;
    border-width: 2px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
    transform: translateY(-2px);
}

textarea.form-control {
    min-height: 120px;
}

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

.form-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Adding a custom badge for confidence levels */
.confidence-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Animation effects */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

/* Make the navbar more compact for languages with longer words */
.navbar-nav {
    flex-wrap: wrap;
}

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

/* Fixes for the language selector and navigation bar */
.language-dropdown {
    margin-left: 0.5rem;
}

/* Language selector styling */
.language-list .list-group-item {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.language-list .list-group-item:hover {
    border-left-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    transform: translateX(3px);
}

.language-list .list-group-item.active {
    border-left-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-body-color);
}

.language-region-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bs-gray-600);
    font-weight: 700;
}

/* Offline mode styling */
.offline-mode {
    /* Subtle indicator in the body background */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.02),
        rgba(0, 0, 0, 0.02) 10px,
        rgba(0, 0, 0, 0.04) 10px,
        rgba(0, 0, 0, 0.04) 20px
    );
}

.offline-mode .navbar {
    /* Add a distinct offline indicator to the navbar */
    border-bottom: 3px solid var(--bs-warning);
}

.offline-mode .navbar::after {
    content: 'OFFLINE MODE';
    position: absolute;
    top: 0.25rem;
    right: 1rem;
    font-size: 0.6rem;
    padding: 2px 6px;
    background-color: var(--bs-warning);
    color: var(--bs-dark);
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 0.5px;
    opacity: 0.9;
    z-index: 100;
}

/* Elements disabled in offline mode */
.offline-disabled {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}

.offline-disabled::after {
    content: 'Unavailable Offline';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
}

/* Override for specific offline-only elements */
.offline-only {
    display: none;
}

.offline-mode .offline-only {
    display: block;
}

/* Toast container */
#toast-container {
    z-index: 1070;
}

/* Enhanced visual feedback for various network states */
.connection-status {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Styling for offline feature cards */
.offline-feature-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.offline-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(var(--bs-primary-rgb), 0.15);
}

.icon-wrapper {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Adjust spacing for mobile devices */
@media (max-width: 768px) {
    .timeline-item-content {
        padding-left: 0.75rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .nav-icon-link {
        padding: 0.5rem;
        margin: 0 0.125rem;
        font-size: 0.85rem;
    }
    
    .nav-icon {
        margin-right: 6px;
        width: 28px;
        height: 28px;
    }
    
    /* Language modal adjustments for mobile */
    .modal-dialog.modal-lg {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .language-list .list-group-item {
        padding: 0.75rem 1rem;
    }
    
    /* Offline mode adjustments for mobile */
    .offline-mode .navbar::after {
        left: 1rem;
        right: auto;
        top: auto;
        bottom: 0.25rem;
        font-size: 0.55rem;
    }
    
    .offline-disabled::after {
        width: 90%;
        text-align: center;
        white-space: normal;
        font-size: 0.8rem;
    }
}
