/* ====== Professional Dashboard Theme ====== */

/* Global Layout */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f8;
    color: #333;
    margin: 0;
    min-height: 100vh;
}
.custom-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.7) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.custom-modal-content {
    background: white !important;
    border-radius: 10px !important;
    width: 90% !important;
    max-width: 800px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5) !important;
    transform: scale(1) !important;
    opacity: 1 !important;
    border: 3px solid red !important; /* Make it very visible */
}

/* Ensure nothing is hiding our modal */
body.modal-open {
    overflow: auto !important;
}
/* Navbar */
.navbar {
    background-color: #1f2937 !important;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff !important;
}

.nav-link {
    color: #e5e7eb !important;
    margin-left: 1rem;
    transition: 0.2s;
}

.nav-link:hover {
    color: #60a5fa !important;
}

/* Dashboard Title */
h2 {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

/* ====== Stats Cards ====== */
.card {
    border: none;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card h6 {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

/* Colored Cards for Stats */
.bg-primary {
    background-color: #2563eb !important;
}
.bg-success {
    background-color: #16a34a !important;
}
.bg-danger {
    background-color: #dc2626 !important;
}
.bg-info {
    background-color: #0284c7 !important;
}

.card.text-white {
    color: #fff !important;
}

/* ====== Chart Section ====== */

.card-header {
    border-radius: 15px 15px 0 0 !important;
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    border-bottom: none;
}
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
    padding: 0.5rem;
}

/* ====== Buttons ====== */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border: none;
}

.btn-primary {
    background-color: #2563eb;
}

.btn-primary:hover {
    background-color: #1e40af;
}

.btn-outline-secondary {
    border: 2px solid #9ca3af;
    color: #374151;
}

.btn-outline-secondary:hover {
    background-color: #9ca3af;
    color: #fff;
}

/* ====== Responsive Design ====== */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.4rem;
    }
}
/* CHATBOT STYLES */
.ai-chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.ai-chat-button {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255,0,0,0.5);
    color: white;
    font-size: 28px;
    z-index: 10000;
    border: 3px solid #ffffff;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { transform: scale(1); box-shadow: 0 4px 20px rgba(255,0,0,0.5); }
    50% { transform: scale(1.1); box-shadow: 0 6px 25px rgba(255,0,0,0.8); }
    100% { transform: scale(1); box-shadow: 0 4px 20px rgba(255,0,0,0.5); }
}

.chat-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    z-index: 9998;
    border: 3px solid #ff0000;
}

.chat-container.active {
    display: flex !important;
}

.chat-header {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.chat-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message {
    align-self: flex-start;
    background: white;
    border: 2px solid #e9ecef;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chat-input {
    padding: 20px;
    border-top: 2px solid #e9ecef;
    display: flex;
    gap: 12px;
    background: white;
    border-radius: 0 0 15px 15px;
}

.chat-input input {
    flex: 1;
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 12px 20px;
    outline: none;
    font-size: 14px;
}

.chat-input input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.btn-send {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-send:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: rgba(255,255,255,0.2);
}

.typing-indicator {
    align-self: flex-start;
    background: white;
    padding: 12px 16px;
    border-radius: 20px;
    border-bottom-left-radius: 5px;
    font-size: 14px;
    color: #666;
    font-style: italic;
    border: 2px solid #e9ecef;
}
/* Sidebar Hidden State */
.gst-sidebar.hidden {
    transform: translateX(-100%);
}

/* Toggle Button Style */
.sidebar-toggle-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: var(--teal-accent);
    border: none;
    padding: 10px 14px;
    font-size: 20px;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    z-index: 1100;
    transition: 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--gold-accent);
    color: black;
}







/* ===== VOICE INPUT - SIMPLE & FORCEFUL STYLES ===== */

/* Microphone button - !important to override everything */
.voice-mic-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    color: #6c757d !important;
    padding: 0 !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
}

/* Hover state */
.voice-mic-btn:hover {
    color: #007bff !important;
    background: rgba(0, 123, 255, 0.1) !important;
}

/* Listening state */
.voice-mic-btn.listening {
    color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.1) !important;
    animation: micPulse 1.5s infinite !important;
}

/* Pulse animation */
@keyframes micPulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* FORCE all text inputs to have right padding */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea {
    padding-right: 40px !important;
}

/* Ensure all form containers are relative */
.form-group,
.input-group,
.mb-3,
.col-form-label,
.form-floating {
    position: relative !important;
}

/* Textarea specific */
textarea + .voice-mic-btn {
    top: 15px !important;
    right: 15px !important;
    transform: none !important;
}

/* Hide mic on disabled/readonly */
input:disabled + .voice-mic-btn,
input[readonly] + .voice-mic-btn,
textarea:disabled + .voice-mic-btn,
textarea[readonly] + .voice-mic-btn {
    display: none !important;
}

/* Modal support */
.modal .form-control {
    padding-right: 40px !important;
}

.modal .voice-mic-btn {
    z-index: 1060 !important;
}

/* Table cells */
td input[type="text"],
td textarea {
    padding-right: 35px !important;
}

td .voice-mic-btn {
    right: 5px !important;
    width: 22px !important;
    height: 22px !important;
}

/* Input groups */
.input-group .form-control {
    padding-right: 40px !important;
}

.input-group .voice-mic-btn {
    right: 40px !important;
}
/* Language Selector Styles */
.voice-language-selector {
    position: fixed !important;
    bottom: 100px !important;
    right: 20px !important;
    z-index: 9999 !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    cursor: pointer !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    height: 40px !important;
    min-width: 60px !important;
}

.voice-lang-current {
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.lang-flag {
    font-size: 16px !important;
}

.lang-code {
    font-size: 12px !important;
    font-weight: bold !important;
    color: #333 !important;
}

.voice-lang-dropdown {
    display: none !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    border-top: 1px solid #eee !important;
}

.voice-language-selector:hover {
    height: auto !important;
    max-height: 400px !important;
}

.voice-language-selector:hover .voice-lang-dropdown {
    display: block !important;
}

.lang-option {
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
}

.lang-option:hover {
    background: #f8f9fa !important;
}

.lang-name {
    font-size: 14px !important;
    flex-grow: 1 !important;
}

/* Language Notification Animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Language badge on microphone button */
.voice-lang-badge {
    position: absolute !important;
    bottom: -5px !important;
    right: -5px !important;
    background: #007bff !important;
    color: white !important;
    font-size: 8px !important;
    padding: 1px 3px !important;
    border-radius: 3px !important;
    line-height: 1 !important;
    font-weight: bold !important;
}

/* Voice input styles */
.voice-mic-btn.listening {
    animation: pulse 1.5s infinite !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4) !important;
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0) !important;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0) !important;
    }
}
/* Language-specific input styling */
.input-lang-ta {
    font-family: 'Noto Sans Tamil', 'Latha', 'Tahoma', 'Arial Unicode MS', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.input-lang-hi, .input-lang-mr {
    font-family: 'Noto Sans Devanagari', 'Mangal', 'Arial Unicode MS', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.input-lang-te {
    font-family: 'Noto Sans Telugu', 'Gautami', 'Arial Unicode MS', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.input-lang-kn {
    font-family: 'Noto Sans Kannada', 'Tunga', 'Arial Unicode MS', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.input-lang-ml {
    font-family: 'Noto Sans Malayalam', 'Kartika', 'Arial Unicode MS', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.input-lang-bn {
    font-family: 'Noto Sans Bengali', 'Vrinda', 'Arial Unicode MS', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.input-lang-gu {
    font-family: 'Noto Sans Gujarati', 'Shruti', 'Arial Unicode MS', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.input-lang-pa {
    font-family: 'Noto Sans Gurmukhi', 'Raavi', 'Arial Unicode MS', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

/* Unicode support */
textarea, input[type="text"], input[type="email"], input[type="search"] {
    unicode-bidi: plaintext !important;
}

/* Better font rendering for Indian scripts */
* {
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Ensure proper Unicode display */
body {
    font-feature-settings: "kern", "liga", "clig", "calt";
}
/* Local Search Bar Container */
.local-search-container {
    padding: 15px 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.local-search-container .search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.local-search-container .search-header h5 {
    margin: 0;
    color: #495057;
}

.local-search-container .search-input-group {
    max-width: 400px;
    margin-left: auto;
}

.local-search-container .search-stats {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Highlight search results */
.highlight-match {
    background-color: #fff3cd !important;
    border: 1px solid #ffeaa7 !important;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #adb5bd;
}