/* ==========================================================================
   Main CSS for CHIM Server UI
   Consolidates styles from style.css, style_new.css, and management.css
   ========================================================================== */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Fasthand&family=Germania+One&family=Spline+Sans+Mono:wght@300&display=swap');

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, code,
del, dfn, em, img, q, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    font-weight: inherit;
    font-style: inherit;
    font-size: 100%;
    font-family: 'Futura CondensedLight', Arial, sans-serif;
}

body {
    font-family: 'Futura CondensedLight', Arial, sans-serif;
    background-color: #2c2c2c;
    color: #f8f9fa;
    font-size: 18px;
    min-height: 100vh;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
    font-family: 'Futura CondensedLight', Arial, sans-serif;
    margin-bottom: 15px;
}

h1 {
    font-size: 32px;
    font-family: 'MagicCards', sans-serif;
    font-weight: normal;
    letter-spacing: 0.5px;
    word-spacing: 8px;
}
h2 { font-size: 26px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

/* Force all primary headings/titles to white across UI pages. */
h1, h2, h3,
.title, .Title,
.page-title, .section-title, .card-title,
#page-title, #title-text {
    color: #ffffff !important;
}

p {
    line-height: 150%;
    margin: 0 0 10px;
    font-size: 18px;
}

em { font-style: italic; }
strong { font-weight: bold; }

/* ==========================================================================
   Links & Buttons
   ========================================================================== */
a {
    color: #eaee05;
    text-decoration: none;
    outline: none;
}

a:hover {
    color: #eaee05;
    text-decoration: underline;
}

/* Trash icon links */
a:has(.bi-trash) {
    color: red !important;
    background-color: rgba(255, 0, 0, 0.1) !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(255, 0, 0, 0.3) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.2s ease !important;
}

a:has(.bi-trash):hover {
    text-decoration: none !important;
    color: white !important;
    background-color: rgba(153, 6, 6, 0.651) !important;
    border-color: red !important;
}

a .bi-trash {
    color: inherit !important;
}

/* Base button styles - shared properties for all buttons */
.button,
.refresh-button,
.action-button,
.alphabet-button,
.copy-btn,
.copy-to-all,
.copy-to-all-btn {
    padding: 10px 20px;
    color: #ffffff;
    background-color: rgba(30, 35, 45, 0.8);
    border: 1px solid rgba(138, 155, 182, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    margin: 5px;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2),
                inset 0 1px rgba(255, 255, 255, 0.1);
}

/* Hover state for all buttons */
.button:hover,
.refresh-button:hover,
.action-button:hover,
.alphabet-button:hover,
.copy-btn:hover,
.copy-to-all:hover,
.copy-to-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
                inset 0 1px rgba(255, 255, 255, 0.15);
    text-decoration: none;
    color: #ffffff;
}

/* Active state for all buttons */
.button:active,
.refresh-button:active,
.action-button:active,
.alphabet-button:active,
.copy-btn:active,
.copy-to-all:active,
.copy-to-all-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2),
                inset 0 1px rgba(255, 255, 255, 0.1);
}

/* Connector page button styles */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-row .btn-save,
.btn-row .btn-primary,
.btn-row .btn-secondary,
.btn-row .btn-danger,
.btn-row .btn-cancel,
.btn-row .modal-close {
    margin: 0;
}

.btn-save,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-cancel,
.modal-close,
.connector-button {
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    border: 1px solid rgba(138, 155, 182, 0.35);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: none;
    transform: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-save,
.connector-button.save {
    background: linear-gradient(135deg, rgba(32, 122, 74, 0.9), rgba(23, 101, 57, 0.9));
    color: #fff;
}

.btn-save:hover,
.connector-button.save:hover {
    background: linear-gradient(135deg, rgba(42, 142, 94, 0.95), rgba(32, 122, 74, 0.95));
}

.btn-primary,
.connector-button.primary {
    background: #204e7a;
    color: #fff;
}

.btn-primary:hover,
.connector-button.primary:hover {
    background: #285c8f;
}

.btn-secondary,
.btn-cancel,
.modal-close,
.connector-button.secondary {
    background: #3a3a3a;
    color: #fff;
}

.btn-secondary:hover,
.btn-cancel:hover,
.modal-close:hover,
.connector-button.secondary:hover {
    background: #4a4a4a;
}

.btn-danger,
.connector-button.danger {
    background: #8b0000;
    color: #fff;
    border-color: #660000;
}

.btn-danger:hover,
.connector-button.danger:hover {
    background: #a00000;
}

.btn-save:focus,
.btn-primary:focus,
.btn-secondary:focus,
.btn-danger:focus,
.btn-cancel:focus,
.modal-close:focus,
.connector-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(138, 155, 182, 0.18);
}

.btn-save:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
.btn-cancel:disabled,
.modal-close:disabled,
.connector-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Refresh button specific styles */
.refresh-button {
    background-color: rgba(23, 162, 184, 0.8);
    border-color: rgba(138, 155, 182, 0.3);
    padding: 8px 16px;
    font-size: 14px;
}

.refresh-button:hover {
    background-color: rgba(33, 172, 194, 0.9);
}

.refresh-button svg {
    margin-right: 8px;
}

.refresh-button.refreshing {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Action button variants */
.action-button {
    padding: 8px 12px;
    font-size: 14px;
}

.action-button.edit {
    background-color: #097b8d;
    border-color: rgba(138, 155, 182, 0.3);
}

.action-button.edit:hover {
    background-color: #076674;
}

.action-button.add-new,
.action-button.upload-csv {
    background-color: #176529;
}

.action-button.add-new:hover,
.action-button.upload-csv:hover {
    background-color: #125121;
}

.action-button.download-csv {
    background-color: rgb(1 53 166 / 90%);
}

.action-button.download-csv:hover {
    background-color: rgb(1 43 135 / 95%);
}

/* Alphabet button styles */
.alphabet-button {
    background-color: rgba(0, 0, 0, 0.85);
    border-color: rgba(75, 75, 75, 0.3);
}

.alphabet-button:hover {
    background-color: rgba(25, 25, 25, 0.95);
}

/* Copy button styles */
.copy-btn {
    padding: 4px 8px;
    font-size: 12px;
    opacity: 0.4;
    background-color: rgba(75, 85, 99, 0.8);
    margin-left: 8px;
}

.voice-item:hover .copy-btn {
    opacity: 0.8;
}

.copy-btn:hover {
    opacity: 1 !important;
    background-color: rgba(85, 95, 109, 0.9);
}

/* Copy to all profiles button styles */
.copy-to-all,
.copy-to-all-btn {
    background-color: rgba(75, 85, 99, 0.8);
    border-color: rgba(156, 163, 175, 0.3);
    font-size: 12px;
    padding: 6px 12px;
}

.copy-to-all:hover,
.copy-to-all-btn:hover {
    background-color: rgba(85, 95, 109, 0.9);
    border-color: rgba(255, 215, 0, 0.4);
}

/* File upload button styling */
input[type="file"] {
    background-color: rgba(30, 35, 45, 0.8);
    color: white;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(138, 155, 182, 0.3);
    cursor: pointer;
    width: auto;
    backdrop-filter: blur(5px);
}

input[type="file"]::-webkit-file-upload-button {
    background-color: rgba(75, 85, 99, 0.8);
    color: white;
    padding: 8px 12px;
    border: 1px solid rgba(138, 155, 182, 0.3);
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s ease-in-out;
    font-size: 14px;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background-color: rgba(85, 95, 109, 0.9);
    transform: translateY(-1px);
}

/* Firefox file input styling */
input[type="file"]::-moz-file-upload-button {
    background-color: rgba(75, 85, 99, 0.8);
    color: white;
    padding: 8px 12px;
    border: 1px solid rgba(138, 155, 182, 0.3);
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s ease-in-out;
    font-size: 14px;
}

input[type="file"]::-moz-file-upload-button:hover {
    background-color: rgba(85, 95, 109, 0.9);
    transform: translateY(-1px);
}

/* Legacy buttonify update */
.buttonify {
    background-color: rgba(30, 35, 45, 0.8);
    border: 1px solid rgba(138, 155, 182, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: white;
}

.buttonify:hover {
    background-color: rgba(40, 45, 55, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
nav {
    font-weight: bold;
    font-size: 20px;
}

.navbar {
    background-color: #031633;
    padding: 10px 0;
}

.navbar-brand {
    font-weight: bold;
    font-size: 30px;
    text-transform: uppercase;
}

/* ==========================================================================
   Configuration Wizard Styles
   ========================================================================== */
.conf-item {
    display: inline-block;
    min-width: 480px;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Futura CondensedLight', Arial, sans-serif;
    max-width: 100%;
    margin-bottom: 15px;
}

.conf-item label {
    display: block;
    color: rgb(242, 124, 17);
    margin-bottom: 5px;
}

.conf-item input[type="text"],
.conf-item input[type="url"],
.conf-item input[type="number"],
.conf-item textarea {
    display: block;
    min-width: 240px;
    padding: 8px;
    background-color: #4a4a4a;
    border: 1px solid #555555;
    border-radius: 4px;
    color: #f8f9fa;
}

.conf-item textarea {
    min-width: 640px;
    min-height: 240px;
    font-family: 'Futura CondensedLight', monospace;
    font-size: medium;
}

.conf-item input.url,
.conf-item input.apikey {
    display: inline-block;
    min-width: 400px;
}

.conf-item span {
    display: block;
    max-width: 400px;
    padding: 3px;
    font-size: 14px;
    font-weight: normal;
    color: white;
}

/* Quick Access Bar */
.quick-access-bar {
    position: fixed;
    top: 160px; /* Positioned below the navbar */
    right: 20px;
    width: 320px;
    height: calc(100vh - 180px);
    background-color: #031633;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    padding: 15px;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow-y: auto;
}

.quick-access-bar .profile-info {
    border-bottom: 1px solid #4a4a4a;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.quick-access-bar .profile-name {
    color: yellow;
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.quick-access-bar .profile-path {
    color: #888;
    font-size: 0.9em;
    margin: 0 0 15px 0;
}

.quick-access-bar .action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.quick-access-bar .section-links {
    height: calc(100% - 150px);
    overflow-y: auto;
}

.quick-access-bar .section-links::-webkit-scrollbar {
    width: 6px;
}

.quick-access-bar .section-links::-webkit-scrollbar-track {
    background: #031633;
}

.quick-access-bar .section-links::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.quick-access-bar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-access-bar li {
    margin: 4px 0;
}

.quick-access-bar li a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.quick-access-bar li a:hover {
    background-color: #022a6a;
    text-decoration: none;
    opacity: 1;
}

.quick-access-bar li.subchild {
    padding-left: 20px;
    font-size: 0.9em;
}

/* Active/open section in quick access */
.quick-access-bar li a.active {
    opacity: 1;
    background-color: #031633;
    border-left: 3px solid #eaee05;
}

/* Fieldset and Legend Styling */
.confwizard fieldset {
    background-color: rgb(32, 32, 32);
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    padding: 25px;
    position: relative;
    width: 70%;
}

/* Main section legend */
.confwizard fieldset > legend {
    background-color: #444444;
    color: #ffffff;
    border-radius: 6px;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    font-family: 'Futura CondensedLight', Arial, sans-serif;
    padding: 8px 15px;
}

/* Subsection legend with arrow */
.confwizard fieldset fieldset legend {
    background-color: transparent;
    color: #eaee05;
    font-size: 18px;
    padding: 8px 15px;
    margin: 10px 0;
    border-bottom: 1px solid #4a4a4a;
    width: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Hover effect for clickable fieldsets */
.confwizard fieldset fieldset legend:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-bottom-color: #eaee05;
    padding-left: 20px;
}

/* Quick access bar link states */
.quick-access-bar li a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.quick-access-bar li a:hover {
    background-color: #022a6a;
    text-decoration: none;
    opacity: 1;
}

/* Active/open section in quick access */
.quick-access-bar li a.active {
    opacity: 1;
    background-color: #031633;
    border-left: 3px solid #eaee05;
}

/* Collapsed fieldset styling */
.unvisible-fieldset {
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
}

.visible-fieldset {
    height: auto;
    opacity: 1;
    transition: all 0.3s ease;
    padding: 15px;
    margin: 10px 0;
}

/* Arrow indicators with transitions */
.arrow, .unarrow {
    position: relative;
    padding-left: 20px;
}

.arrow::before, .unarrow::before {
    content: '▼';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transition: transform 0.3s ease;
    font-size: 12px;
}

.unarrow::before {
    transform: translateY(-50%) rotate(0);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .confwizard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .confwizard {
        margin-right: 0;
    }
    
    .quick-access-bar {
        display: none;
    }
}

/* ==========================================================================
   Tables
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #1a1a1a;
    margin-bottom: 20px;
    font-size: small;
}

th, td {
    border: 1px solid #333333;
    padding: 8px;
    text-align: left;
    color: #e0e0e0;
}

th {
    background-color: #2d2d2d;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #1f1f1f;
}

/* Table Color Variants */
.table-primary-dark {
    background-color: #2c3440 !important; /* Deep slate blue-gray */
    color: #e0e0e0 !important;
}

.table-success-dark {
    background-color: #374151 !important; /* Cool gray */
    color: #e0e0e0 !important;
}

.table-info-dark {
    background-color: #283344 !important; /* Navy slate */
    color: #e0e0e0 !important;
}

.table-warning-dark {
    background-color: #2d3748 !important; /* Steel blue-gray */
    color: #e0e0e0 !important;
}

.table-danger-dark {
    background-color: #3a2d48 !important; /* Darker purple */
    color: #e0e0e0 !important;
}


/* Ensure text remains readable in colored cells */
td[class*="-dark"] {
    border-color: rgba(255, 255, 255, 0.1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Add subtle transition for hover effects */
td[class*="-dark"] {
    transition: all 0.3s ease-in-out;
}

/* Add subtle inner shadow for depth */
td[class*="-dark"] {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* ==========================================================================
   Modal & Overlay Styles
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none; /* Hidden by default */
}

.modal-container {
    position: fixed;
    top: 80px; /* Fixed padding from top */
    left: 50%;
    transform: translateX(-50%); /* Only center horizontally */
    background-color: #3a3a3a;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
input[type="text"],
input[type="number"],
input[type="url"],
textarea,
select {
    background-color: #4a4a4a;
    border: 1px solid #555555;
    color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
}

input[type="radio"],
input[type="checkbox"] {
    margin-right: 5px;
}

/* Global Settings: native enhanced checkbox styling */
.provider-card .provider-body input[type="checkbox"] {
    accent-color: #176529 !important;
    /* Use transform for reliable visual sizing across browsers */
    transform: scale(1.4) !important;
    transform-origin: center;
    margin: 0 !important; /* rely on flex gap from .provider-body */
    flex: 0 0 auto;
    cursor: pointer;
    vertical-align: middle;
}

.provider-card .provider-body input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(23, 101, 41, 0.6);
    outline-offset: 2px;
}

/* Consistent spacing for the inline "Enable" label */
.provider-card .provider-body > label {
    min-width: 180px;
    margin-right: 10px;
    cursor: default;
}

/* Range Input Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #4a4a4a;
    outline: none;
    margin-bottom: 5px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

/* Boolean Input Styling */
.conf-item[data-type="boolean"] {
    color: rgb(242, 124, 17);
}

.conf-item[data-type="boolean"] label[for] {
    color: #ffffff;
    display: inline;
    margin-left: 5px;
}


@media (max-width: 800px) {
    .conf-item {
        min-width: 100%;
    }
    
    .conf-item textarea {
        min-width: 100%;
    }
}

@media (max-width: 500px) {
    .button {
        width: 100%;
        text-align: center;
    }
}

/* Form Management */
.form-container {
    background-color: #3a3a3a;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #4a4a4a;
    max-width: 600px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

/* Action Buttons */
.action-button {
    display: inline-block;
    padding: 8px 12px;
    color: #ffffff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button:hover {
    color: #ffffff;
    text-decoration: none;
}

.action-button.edit {
    background-color: #097b8d;
}
.action-button.edit:hover {
    background-color: #076674;
}

.action-button.add-new {
    background-color: #176529;
}
.action-button.add-new:hover {
    background-color: #125121;
}

.action-button.upload-csv {
    background-color: #176529;
}
.action-button.upload-csv:hover {
    background-color: #125121;
}

.action-button.download-csv {
    background-color: rgb(1 53 166 / 90%);
}
.action-button.download-csv:hover {
    background-color: rgb(1 43 135 / 95%);
}

/* File input styling */
input[type="file"] {
    background-color: #4a4a4a;
    color: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #555;
    cursor: pointer;
    width: auto;
}

input[type="file"]::-webkit-file-upload-button {
    background-color: #6c757d;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background-color: #5a6268;
}

/* Firefox file input styling */
input[type="file"]::-moz-file-upload-button {
    background-color: #6c757d;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

input[type="file"]::-moz-file-upload-button:hover {
    background-color: #5a6268;
}

/* Voice Management */
.voice-list-container {
    background-color: #2c2c2c;
    border: 1px solid #4a4a4a;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

.voice-list-header {
    margin-bottom: 15px;
    padding: 0 10px;
}

.voice-list-header h3 {
    color: #fff;
    font-size: 1.2em;
    margin: 0;
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.voice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #2a2a2a;
    border-radius: 4px;
    color: #fff;
    transition: background-color 0.2s ease;
}

.voice-item:hover {
    background-color: #333;
}

/* Speakers Grid */
.speakers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.speaker-item {
    background-color: #4a4a4a;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #555555;
    color: #f8f9fa;
    text-align: center;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 44, 44, 0.95);
    z-index: 9999;
    display: none;
}

#loading-overlay p {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #f8f9fa;
    font-size: 20px;
    text-align: center;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 150px; /* Just below navbar */
    left: 50%;
    transform: translateX(-50%);
    background-color: #3a3a3a;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1002;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid #555;
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
}

.toast-notification .message {
    display: block;
    text-align: center;
    line-height: 1.4;
}

/* Standardized Button System */
.btn-base,
.btn-danger,
.btn-cancel,
.btn-save,
.btn-primary {
    padding: 10px 20px;
    color: #ffffff;
    background-color: rgba(30, 35, 45, 0.8);
    border: 1px solid rgba(138, 155, 182, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    margin: 5px;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2),
                inset 0 1px rgba(255, 255, 255, 0.1);
}

.btn-base:hover,
.btn-danger:hover,
.btn-cancel:hover,
.btn-save:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
                inset 0 1px rgba(255, 255, 255, 0.15);
}

.btn-base:active,
.btn-danger:active,
.btn-cancel:active,
.btn-save:active,
.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2),
                inset 0 1px rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background-color: rgba(166, 53, 63, 0.9);
    border-color: rgba(255, 99, 99, 0.3);
}

.btn-danger:hover {
    background-color: rgba(146, 43, 53, 0.8);
    border-color: rgba(255, 99, 99, 0.4);
}

.btn-save {
    background-color: #176529;
    border-color: rgba(72, 187, 120, 0.3);
}

.btn-save:hover {
    background-color: #125121;
    border-color: rgba(72, 187, 120, 0.4);
}

.btn-cancel {
    background-color: rgba(85, 95, 109, 0.9);

    border-color: rgba(156, 163, 175, 0.3);
}

.btn-cancel:hover {
    background-color: rgba(75, 85, 99, 0.8);
    border-color: rgba(156, 163, 175, 0.4);
}

.btn-primary {
    background-color: rgb(1 53 166 / 90%);
    border-color: rgba(96, 165, 250, 0.3);
    background-image: linear-gradient(180deg, 
                      rgba(255, 255, 255, 0.08) 0%,
                      rgba(255, 255, 255, 0) 100%);
}

.btn-primary:hover {
    background-color: rgb(1 43 135 / 95%);
    border-color: rgba(96, 165, 250, 0.4);
}

/* Add subtle glow effect for focus state */
.btn-base:focus,
.btn-danger:focus,
.btn-cancel:focus,
.btn-save:focus,
.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(138, 155, 182, 0.15),
                0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Disabled state */
.btn-base:disabled,
.btn-danger:disabled,
.btn-cancel:disabled,
.btn-save:disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Table Container */
.table-container {
    max-height: 900px;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 20px;
    width: 100%;
}


/* Code Block */
code {
    background-color: #000000;
    padding: 2px 4px;
    border-radius: 3px;
    color: #f8f9fa;
}

/* Warning Text */
.warning-text {
    color: yellow;
}

/* Scrollbar Styling */
.voice-grid::-webkit-scrollbar {
    width: 8px;
}

.voice-grid::-webkit-scrollbar-track {
    background: #2c2c2c;
    border-radius: 4px;
}

.voice-grid::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.voice-grid::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Copy Button */
.copy-btn {
    opacity: 0.4;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.voice-item:hover .copy-btn {
    opacity: 0.8;
}

.copy-btn:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Action Container */
.action-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-container {
    flex-grow: 1;
    max-width: 400px;
    display: flex;
    gap: 10px;
}

/* Alphabet Buttons */
.alphabet-button {
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 6px 10px;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.85);
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid rgba(75, 75, 75, 0.3);
}

.alphabet-button:hover {
    background-color: rgba(25, 25, 25, 0.95);
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================================================
   Legacy Support
   ========================================================================== */
/* Support for old buttonify class */
.buttonify {
    display: inline-block;
    border: 1px solid grey;
    cursor: pointer;
    background-color: lightgrey;
    min-width: 64px;
    padding: 2px;
    border-radius: 1px;
    text-align: center;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Support for old menu styles */
#menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#menu ul li {
    position: relative;
    float: left;
    margin: 0;
    padding: 0;
    background-color: #2e518b;
}

#menu ul a {
    display: block;
    color: #fff;
    text-decoration: none;
    font-weight: 400;
    font-size: 22px;
    padding: 10px;
    letter-spacing: 1px;
}

#menu ul li:hover {
    background: #5b78a7;
}

#menu ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #eee;
    padding: 0;
}

#menu ul ul li {
    float: none;
    width: 150px;
}

#menu ul ul a {
    line-height: 120%;
    padding: 10px 15px;
}

#menu ul li:hover > ul {
    display: block;
    z-index: 101;
}

/* Support for old debug pane */
.debugpane {
    padding: 5px;
    background-color: grey;
    display: none;
}

.menupane {
    min-height: 38px;
}

/* Support for old datatable */
.datatable {
    max-height: 700px;
    overflow: scroll;
    font-family: 'Futura CondensedLight', "Spline Sans Mono";
    font-weight: bold;
    border: 1px solid lightgray;
}

/* Support for foldable elements */
.foldable {
    display: none;
}

/* Support for model updates */
.model-updated {
    background-image: url("clickme.gif");
    color: black;
}

/* Support for arrow indicators */
.arrow {
    background-repeat: no-repeat;
    background-position: left top;
    padding-left: 25px;
}

.unarrow {
    background-repeat: no-repeat;
    background-position: left bottom;
    padding-left: 25px;
}

/* Copy to All Profiles Button */
.copy-to-all {
    padding: 10px 20px;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s, color 0.3s;
    margin: 5px 0;
    font-weight: bold;
    background-color: #444444;
    width: fit-content;
}

.copy-to-all:hover {
    background-color: #666666;
    border-color: #FFD700;
}

/* Copy to All Profiles Button */
.copy-to-all-btn {
    color: #FFFFFF;
    cursor: pointer;
    font-size: 9px;
    display: block;
    position: relative;
    background-color: #444444;
    border: 1px solid #FFFFFF;
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
}

.copy-to-all-btn:hover {
    background-color: #666666;
    border-color: #FFD700;
}

/* ==========================================================================
   Adventure Log Styles
   ========================================================================== */

/* CSV Buttons Container */
.csv-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    margin-top: 10px;
}

.csv-buttons .button {
    margin: 5px 10px; /* Consistent spacing between CSV buttons */
}

/* ==========================================================================
   Generic Plugin Installer (ext/generic_installer.php) Theme Alignment
   ========================================================================== */
body .installer-container {
    max-width: 980px;
    margin: 36px auto;
    padding: 28px;
    border-radius: 12px;
    border: 1px solid rgba(138, 155, 182, 0.3);
    background:
        radial-gradient(circle at top right, rgba(1, 53, 166, 0.18), transparent 42%),
        radial-gradient(circle at top left, rgba(23, 101, 41, 0.12), transparent 48%),
        rgba(18, 22, 29, 0.92);
    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.35),
        inset 0 1px rgba(255, 255, 255, 0.08);
}

body .installer-container > h1 {
    margin-bottom: 14px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

body .installer-container .back-button {
    margin: 0 0 18px !important;
}

body .installer-container h3 {
    color: #f8f9fa;
    border-bottom: 1px solid rgba(138, 155, 182, 0.22);
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 10px;
}

body .installer-container .version-info-block {
    border: 1px solid rgba(138, 155, 182, 0.26);
    border-left: 4px solid rgb(1 53 166 / 90%);
    border-radius: 10px;
    background-color: rgba(12, 16, 24, 0.75);
    padding: 18px 20px;
    margin-bottom: 22px;
}

body .installer-container .version-info-block p {
    margin: 8px 0;
    color: #d6dbe6;
    font-size: 16px;
}

body .installer-container .version-info-block strong {
    color: #ffffff;
}

body .installer-container .installer-log {
    border: 1px solid rgba(138, 155, 182, 0.26);
    border-radius: 10px;
    background-color: rgba(7, 10, 16, 0.95);
    color: #d6dbe6;
    padding: 16px 18px;
    max-height: 52vh;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

body .installer-container .installer-log p {
    margin: 5px 0;
    line-height: 1.45;
}

body .installer-container .installer-log::-webkit-scrollbar {
    width: 9px;
}

body .installer-container .installer-log::-webkit-scrollbar-thumb {
    background-color: rgba(138, 155, 182, 0.6);
    border-radius: 999px;
}

body .installer-container .installer-log::-webkit-scrollbar-thumb:hover {
    background-color: rgba(138, 155, 182, 0.85);
}

body .installer-container .log-info {
    color: #7fd3ff;
}

body .installer-container .log-action,
body .installer-container .log-running {
    color: #f8e08f;
}

body .installer-container .log-completed,
body .installer-container .log-success {
    color: #5ad17f;
}

body .installer-container .log-skipped {
    color: #9aa5b5;
}

body .installer-container .log-error,
body .installer-container .log-failed {
    color: #ff8f8f;
}

body .installer-container .system-command-output {
    margin: 8px 0 14px 10px;
    padding: 8px 12px;
    border-left: 3px solid rgba(138, 155, 182, 0.36);
    border-radius: 0 8px 8px 0;
    background-color: rgba(10, 13, 20, 0.88);
    color: #b8c2d1;
}

body .installer-container .status-message {
    margin-top: 18px;
    border-radius: 10px;
    border: 1px solid rgba(138, 155, 182, 0.28);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body .installer-container .status-success {
    background: linear-gradient(180deg, rgba(23, 101, 41, 0.94), rgba(18, 76, 31, 0.94));
    border-color: rgba(72, 187, 120, 0.32);
}

body .installer-container .status-error {
    background: linear-gradient(180deg, rgba(166, 53, 63, 0.94), rgba(136, 40, 49, 0.94));
    border-color: rgba(255, 99, 99, 0.34);
}

@media (max-width: 768px) {
    body .installer-container {
        margin: 16px auto;
        padding: 18px;
    }

    body .installer-container > h1 {
        font-size: 26px;
    }
}

.sidebar-action-grid,
.btn-row.sidebar-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 6px 0 10px 4px;
}

.sidebar-action-grid > form {
    display: block;
    margin: 0;
    min-width: 0;
}

.sidebar-action-grid > button,
.sidebar-action-grid > a,
.sidebar-action-grid > form > button {
    width: 100%;
    min-height: 36px;
    margin: 0;
    justify-content: center;
    background-image: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.sidebar-action-grid.single-action > form,
.sidebar-action-grid.single-action > button,
.sidebar-action-grid.single-action > a {
    grid-column: 1 / -1;
}
