/* AI Marketplace & White-Label Licensing Hub - Custom Styles */

/* Navigation fixes to prevent text wrapping */
.navbar-nav .nav-link {
    white-space: nowrap;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem !important;
}

.navbar-nav .dropdown-toggle::after {
    margin-left: 0.25rem;
}

.navbar-brand {
    font-size: 1.1rem !important;
    margin-right: 1rem;
}

/* Responsive navigation adjustments */
@media (min-width: 992px) {
    .navbar-nav .nav-item {
        margin-right: 0.25rem;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.6rem !important;
    }
}

@media (max-width: 1200px) {
    .navbar-nav .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.5rem !important;
    }
}

/* Category filter improvements for AI Agents page */
.btn-sm {
    font-size: 0.8rem !important;
    padding: 0.35rem 0.6rem !important;
}

/* Ensure category buttons wrap properly and save space */
.d-flex.flex-wrap.gap-2 .btn {
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
}

/* Make category filter more compact */
.d-flex.flex-wrap.gap-2 {
    line-height: 1.2;
}

/* Responsive category filter adjustments */
@media (max-width: 768px) {
    .d-flex.flex-wrap.gap-2 .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem !important;
    }
}

/* Dark Theme Variables */
:root {
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    
    /* Custom colors */
    --purple: #6f42c1;
    --gradient-primary: linear-gradient(135deg, #0d6efd 0%, #6f42c1 100%);
    --gradient-dark: linear-gradient(135deg, #212529 0%, #343a40 100%);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Animation variables */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #dee2e6;
    background-color: #0d1117;
}

/* Custom gradient backgrounds */
.bg-gradient-dark {
    background: var(--gradient-dark);
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-purple {
    background-color: var(--purple);
}

.text-purple {
    color: var(--purple);
}

/* Enhanced shadows */
.shadow-custom {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25);
}

.shadow-hover {
    transition: box-shadow var(--transition-normal);
}

.shadow-hover:hover {
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.3);
}

/* Card enhancements */
.card {
    border: 1px solid rgba(255, 255, 255, 0.125);
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.card-hover {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

/* Button enhancements */
.btn {
    font-weight: 500;
    transition: all var(--transition-fast);
    border-radius: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.25);
}

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

.btn-success {
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
}

.btn-outline-primary {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: translateY(-2px);
}

/* Navigation enhancements */
.navbar {
    backdrop-filter: blur(20px);
    background-color: rgba(33, 37, 41, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

/* Hero section */
.min-vh-50 {
    min-height: 50vh;
}

/* Form enhancements */
.form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #dee2e6;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    color: #fff;
}

.form-control::placeholder {
    color: rgba(222, 226, 230, 0.6);
}

.form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #dee2e6;
}

.form-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Table enhancements */
.table-dark {
    --bs-table-bg: rgba(255, 255, 255, 0.02);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.075);
}

/* Alert enhancements */
.alert {
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
}

.alert-primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    color: #cfe2ff;
    border-left: 4px solid var(--bs-primary);
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
    color: #d1e7dd;
    border-left: 4px solid var(--bs-success);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    color: #f5c2c7;
    border-left: 4px solid var(--bs-danger);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    color: #fff3cd;
    border-left: 4px solid var(--bs-warning);
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%);
    color: #cff4fc;
    border-left: 4px solid var(--bs-info);
}

/* Badge enhancements */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

/* Progress bar enhancements */
.progress {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

.progress-bar {
    border-radius: 1rem;
}

/* Modal enhancements */
.modal-content {
    background-color: #1c1f26;
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 1rem;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.125);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.125);
}

/* Dropdown enhancements */
.dropdown-menu {
    background-color: #1c1f26;
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: #dee2e6;
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* List group enhancements */
.list-group-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.125);
    color: #dee2e6;
}

.list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Accordion enhancements */
.accordion-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

.accordion-button {
    background-color: rgba(255, 255, 255, 0.05);
    color: #dee2e6;
    border: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--bs-primary);
}

/* Breadcrumb enhancements */
.breadcrumb {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #4dabf7;
}

/* Spinner enhancements */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Loading animations */
.fade-in {
    animation: fadeIn var(--transition-slow) ease-in;
}

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

.slide-up {
    animation: slideUp var(--transition-normal) ease-out;
}

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

/* Pulse animation for loading states */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Hover effects */
.hover-lift {
    transition: transform var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.5);
}

/* Utility classes */
.bg-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05)) padding-box,
                var(--gradient-primary) border-box;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .dropdown,
    .modal {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #fff;
    }
    
    .btn-outline-primary {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--bs-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--bs-success);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: var(--bs-dark);
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
}

.chatbot-window.show {
    display: flex;
    animation: chatbotSlideIn 0.3s ease-out;
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chatbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex container */
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chatbot-message {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chatbot-message-bot .chatbot-message-avatar {
    background: var(--bs-primary);
    color: white;
}

.chatbot-message-user .chatbot-message-avatar {
    background: var(--bs-success);
    color: white;
}

.chatbot-message-content {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 85%;
}

.chatbot-message-bot .chatbot-message-content {
    background: rgba(255, 255, 255, 0.1);
    color: var(--bs-light);
    border-bottom-left-radius: 0.25rem;
}

.chatbot-message-user .chatbot-message-content {
    background: var(--bs-primary);
    color: white;
    border-bottom-right-radius: 0.25rem;
    margin-left: auto;
}

.chatbot-input {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.125);
    flex-shrink: 0; /* Prevent input area from shrinking */
}

.chatbot-input .input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-input .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--bs-light);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    flex: 1;
}

.chatbot-input .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--bs-primary);
    color: white;
    box-shadow: 0 0 0 0.125rem rgba(var(--bs-primary-rgb), 0.25);
}

.chatbot-input .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.chatbot-input .btn {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Voice button styles */
.voice-btn {
    background: linear-gradient(135deg, #6f42c1, #d63384);
    border: none;
    color: white;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.voice-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

.voice-btn.playing {
    background: linear-gradient(135deg, #fd7e14, #dc3545);
    animation: pulse 2s infinite;
}

.voice-btn.paused {
    background: linear-gradient(135deg, #20c997, #198754);
    border: 2px solid #20c997;
    animation: none;
}

.voice-btn.paused:hover {
    background: linear-gradient(135deg, #198754, #157347);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(32, 201, 151, 0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.voice-offer {
    margin-top: 0.75rem !important;
    padding: 0.75rem !important;
    background: rgba(111, 66, 193, 0.1) !important;
    border: 1px solid rgba(111, 66, 193, 0.3);
    border-radius: 0.75rem !important;
}

/* Quick suggestions */
.quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.quick-suggestion {
    background: rgba(var(--bs-primary-rgb), 0.1);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.3);
    color: var(--bs-primary);
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-suggestion:hover {
    background: rgba(var(--bs-primary-rgb), 0.2);
    transform: translateY(-1px);
}

/* Typing indicator */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
}

.typing-indicator {
    display: flex;
    gap: 0.25rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--bs-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Responsive chatbot */
@media (max-width: 480px) {
    .chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: 20%;
        width: 100%;
        height: 80%;
        border-radius: 1rem 1rem 0 0;
    }
    
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
}

/* Network Animation Styles */
.ai-network-kpi-section .kpi-badge {
    animation: float 3s ease-in-out infinite;
}

.ai-network-kpi-section .kpi-badge:nth-child(2) {
    animation-delay: -0.5s;
}

.ai-network-kpi-section .kpi-badge:nth-child(3) {
    animation-delay: -1s;
}

.ai-network-kpi-section .kpi-badge:nth-child(4) {
    animation-delay: -1.5s;
}

.ai-network-kpi-section .orbit-node {
    animation: pulse 2s ease-in-out infinite;
}

.ai-network-kpi-section .particle {
    animation: twinkle 2.5s ease-in-out infinite;
}

/* Enhanced KPI Float Animation */
@keyframes kpiFloat {
    0%, 100% { 
        transform: translateY(0px); 
        opacity: 0.95;
    }
    50% { 
        transform: translateY(-8px); 
        opacity: 1;
    }
}

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

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

@keyframes twinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.3; }
}
