/* Custom styles for AI Model Comparison Tool */

/* Black background for the entire page */
body {
    background-color: black !important;
}

/* CRITICAL DROPDOWN Z-INDEX OVERRIDE */
.navbar .dropdown-menu {
    z-index: 999999 !important;
    position: absolute !important;
}

.navbar .nav-item.dropdown {
    z-index: 999999 !important;
    position: relative !important;
}

.navbar {
    z-index: 99999 !important;
}

.ai-response-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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


.response-content {
    font-size: 0.93rem;
    line-height: 1.7;
    padding: 1.25rem;
    color: rgba(255, 255, 255, 0.88);
}

.response-content::-webkit-scrollbar {
    width: 5px;
}

.response-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.response-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.response-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.metadata-row {
    padding: 0.85rem 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.md-rendered .md-heading {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.35rem;
}

.md-rendered h1.md-heading { font-size: 1.3rem; }
.md-rendered h2.md-heading { font-size: 1.15rem; }
.md-rendered h3.md-heading { font-size: 1.05rem; color: rgba(0, 194, 255, 0.9); border-bottom: none; }
.md-rendered h4.md-heading { font-size: 0.95rem; color: rgba(0, 194, 255, 0.8); border-bottom: none; }

.md-rendered .md-para {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.md-rendered .md-list {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.md-rendered .md-list li {
    margin-bottom: 0.35rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.md-rendered strong {
    color: rgba(255, 255, 255, 0.97);
    font-weight: 600;
}

.md-rendered code {
    background: rgba(0, 162, 255, 0.1);
    color: #7dd3fc;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}

.md-rendered em {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

/* Attachment button styling - slightly larger */
.attachment-btn {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.attachment-btn:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    color: white !important;
}

/* Voice input button styling - slightly larger */
.voice-btn {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Advanced Query Options button - slightly larger */
.btn-outline-light {
    padding: 0.5rem 0.8rem !important;
    font-size: 0.9rem !important;
}

/* Patent Pending buttons - slightly larger */
.btn-outline-warning {
    padding: 0.4rem 0.7rem !important;
    font-size: 0.85rem !important;
}

/* Mobile responsive fixes for AI model names */
@media (max-width: 767px) {
    .ai-model-option {
        padding: 0.6rem 0.8rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    .ai-model-option .ai-model-name {
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .ai-model-option .ai-model-description {
        font-size: 0.8rem !important;
        line-height: 1.1 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Ensure model selection container has proper spacing */
    .model-selection-container {
        padding: 0.5rem !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Fix checkbox positioning on mobile */
    .ai-model-option input[type="checkbox"] {
        flex-shrink: 0 !important;
        margin-right: 0.6rem !important;
    }
    
    /* Better text wrapping for model badges */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
        white-space: nowrap !important;
    }
    
    /* Mobile-only button size adjustments */
    .attachment-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.65rem !important;
    }
    
    .voice-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.65rem !important;
    }
    
    .compact-btn {
        padding: 0.1rem 0.25rem !important;
        font-size: 0.55rem !important;
        height: 18px !important;
    }
    
    .btn-outline-light {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
    
    .btn-outline-warning {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
}

.attachment-btn:active,
.attachment-btn:focus {
    background-color: #bd2130 !important;
    border-color: #b21f2d !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.voice-input-container {
    margin-top: 8px;
}

/* Attachment preview styling */
.attachment-preview {
    font-size: 0.875rem;
}

.attachment-preview .btn-sm {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Character counter */
#charCount {
    font-weight: 500;
}

.char-warning {
    color: var(--bs-warning) !important;
}

.char-danger {
    color: var(--bs-danger) !important;
}

/* Genesis Core Brain-Microchip Icon Animations */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

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

/* Genesis Core title uses default Bootstrap styling */

/* Responsive improvements */
@media (max-width: 768px) {
    .display-4, .genesis-title {
        font-size: 2rem;
    }
    
    .ai-response-card {
        margin-bottom: 1rem;
    }
    
    .response-content {
    }
}

/* Quality indicators */
.quality-excellent { border-left: 4px solid var(--bs-success); }
.quality-good { border-left: 4px solid var(--bs-info); }
.quality-fair { border-left: 4px solid var(--bs-warning); }
.quality-poor { border-left: 4px solid var(--bs-danger); }

/* Service-specific styling */
.service-gpt4 { border-left: 4px solid var(--bs-success); }
.service-claude { border-left: 4px solid var(--bs-info); }
.service-gemini { border-left: 4px solid var(--bs-warning); }

/* Smooth transitions */
.card {
    transition: all 0.3s ease;
}

.btn {
    transition: all 0.2s ease;
}

/* Focus states for accessibility */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Custom alerts */
.alert {
    border: none;
    border-radius: 8px;
}

/* Loading modal improvements */
.modal-content {
    border-radius: 12px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Ensure loading modal works properly on mobile */
@media (max-width: 768px) {
    .modal {
        z-index: 1055 !important;
    }
    
    .modal-backdrop {
        z-index: 1054 !important;
    }
    
    #loadingModal {
        z-index: 1056 !important;
    }
    
    #loadingModal .modal-dialog {
        margin: 1.75rem auto !important;
        max-width: 90vw !important;
    }
    
    #loadingModal .modal-content {
        background: rgba(33, 37, 41, 0.95) !important;
        border: 1px solid #6c757d !important;
        backdrop-filter: blur(10px) !important;
    }
    
    #loadingModal .modal-body {
        padding: 2rem 1rem !important;
    }
    
    #loadingModal .modal-body h5 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    #loadingModal .modal-body p {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
    
    /* Mobile navigation dropdown fix */
    .navbar-collapse {
        z-index: 2147483648 !important;
        position: relative !important;
        background: rgba(13, 27, 42, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        border-radius: 0 0 8px 8px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
        margin-top: 8px !important;
        padding: 1rem !important;
        padding-top: 3rem !important;
    }
    
    /* Ensure mobile nav items are left-aligned */
    .navbar-nav.me-auto {
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: left !important;
        width: 100% !important;
    }
    
    .navbar-nav.me-auto .nav-item {
        width: 100% !important;
        text-align: left !important;
    }
    
    .navbar-nav.me-auto .nav-link {
        text-align: left !important;
        justify-content: flex-start !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    /* Ensure auth buttons are right-aligned on mobile */
    .navbar-nav.align-items-center {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        text-align: right !important;
        justify-content: flex-end !important;
        width: auto !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
        position: absolute !important;
        top: 1rem !important;
        right: 1rem !important;
    }
    
    .navbar-nav.align-items-center .nav-item {
        margin-left: 0 !important;
        display: flex !important;
        justify-content: flex-end !important;
    }
    
    /* Fix navbar brand spacing on mobile */
    .navbar-brand {
        margin-right: auto !important;
    }
    
    /* Ensure navbar toggler is properly positioned */
    .navbar-toggler {
        margin-left: auto !important;
        z-index: 2147483649 !important;
    }
    
    /* Override any conflicting modal z-indexes on mobile */
    .modal {
        z-index: 2147483650 !important;
    }
    
    #analyticsModal, #communityModal, #userModal {
        z-index: 2147483651 !important;
    }
    
    #analyticsModal .modal-dialog, #communityModal .modal-dialog, #userModal .modal-dialog {
        z-index: 2147483652 !important;
        position: fixed !important;
    }
    
    #analyticsModal .modal-content, #communityModal .modal-content, #userModal .modal-content {
        z-index: 2147483653 !important;
        position: relative !important;
    }
    
    /* Ensure main content doesn't overlap navigation */
    .container {
        z-index: 1 !important;
        position: relative !important;
    }
    
    body {
        z-index: 0 !important;
        position: relative !important;
    }
    
    /* Force dropdown modals to appear above everything on mobile */
    .modal[style*="display: block"] {
        z-index: 2147483653 !important;
    }
    
    /* Specific modal positioning fixes */
    #analyticsModal[style*="display: block"], #communityModal[style*="display: block"] {
        z-index: 2147483654 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        pointer-events: auto !important;
    }
    
    #analyticsModal .modal-dialog, #communityModal .modal-dialog {
        z-index: 2147483655 !important;
        position: fixed !important;
        margin: 0 !important;
        max-width: 200px !important;
        width: 200px !important;
    }
    
    /* Make dropdown content smaller and more compact on mobile */
    #analyticsModal .modal-content, #communityModal .modal-content {
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    #analyticsModal .list-group-item, #communityModal .list-group-item {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
        border: none !important;
    }
    
    #analyticsModal .list-group-item i, #communityModal .list-group-item i {
        font-size: 0.8rem !important;
        width: 16px !important;
    }
}

.btn-outline-success[data-action="submitFeedback"],
.btn-outline-success[data-helpful="true"] {
    background: rgba(45, 122, 58, 0.12) !important;
    color: #6fcf7c !important;
    border: 1px solid rgba(111, 207, 124, 0.3) !important;
    border-radius: 20px !important;
    padding: 5px 16px !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.btn-outline-success[data-action="submitFeedback"]:hover,
.btn-outline-success[data-helpful="true"]:hover {
    background: rgba(45, 122, 58, 0.25) !important;
    color: #8ee09a !important;
    border-color: rgba(111, 207, 124, 0.5) !important;
    box-shadow: 0 2px 10px rgba(45, 122, 58, 0.25) !important;
}

.btn-outline-danger[data-action="submitFeedback"],
.btn-outline-danger[data-helpful="false"] {
    background: rgba(197, 48, 48, 0.12) !important;
    color: #f08080 !important;
    border: 1px solid rgba(240, 128, 128, 0.3) !important;
    border-radius: 20px !important;
    padding: 5px 16px !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.btn-outline-danger[data-action="submitFeedback"]:hover,
.btn-outline-danger[data-helpful="false"]:hover {
    background: rgba(197, 48, 48, 0.25) !important;
    color: #ffa0a0 !important;
    border-color: rgba(240, 128, 128, 0.5) !important;
    box-shadow: 0 2px 10px rgba(197, 48, 48, 0.25) !important;
}

.btn-success[data-action="submitFeedback"],
.btn-success[data-helpful="true"] {
    background: rgba(45, 122, 58, 0.35) !important;
    color: #8ee09a !important;
    border: 1px solid rgba(111, 207, 124, 0.5) !important;
    border-radius: 20px !important;
    padding: 5px 16px !important;
    font-weight: 500 !important;
    font-size: 0.8rem !important;
}

.border-top .btn-group[role="group"] {
    gap: 6px !important;
}

.btn-group[role="group"] .btn[data-action="submitFeedback"],
.btn-group[role="group"] .btn[data-helpful] {
    border-radius: 20px !important;
}

@media (max-width: 991.98px) {
    #loadingModal .modal-content,
    .navbar-collapse {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    #loadingModal .modal-content {
        background: rgba(33, 37, 41, 0.97) !important;
    }

    .navbar-collapse {
        background: rgba(0, 0, 0, 0.97) !important;
    }
}

.mobile-dropdown-fix-v9 {
    display: none;
}
