/* Header tabella */
thead.custom-header { 
    background-color: #0d6efd; 
    color: #fff; 
}

/* Colonne specifiche */
th.tipo, td.tipo, th.difficolta, td.difficolta, th.autore, td.autore { 
    width: 100px; 
    white-space: nowrap; 
}

/* Colorazione difficoltà */
td.easy { color: #198754; font-weight: bold; text-align: center; }
td.medium { color: #ffc107; font-weight: bold; text-align: center; }
td.hard { color: #dc3545; font-weight: bold; text-align: center; }

/* Barra ricerca */
.table-search-container { 
    display: flex; 
    justify-content: flex-end; 
    margin-bottom: 10px; 
}

.input-group { 
    max-width: 300px; 
}

/* Filtro clessidra */
.filter-dropdown { 
    cursor: pointer; 
    margin-left: 5px; 
}

.filter-menu { 
    min-width: 150px; 
    max-height: 200px; 
    overflow-y: auto; 
    display: none; 
    position: absolute; 
    z-index: 1000; 
    padding: 5px; 
}

.filter-menu div { 
    padding: 2px 5px; 
    cursor: pointer; 
}

/* AI Validation Styles */
.ai-check-cell {
    width: 100px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    padding: 8px 4px;
}

.ai-status-btn {
    font-size: 0.8rem;
    min-width: 70px;
    white-space: nowrap;
}

/* Modal Styles */
#aiValidationModal .modal-header {
    border-radius: 0.375rem 0.375rem 0 0;
}

#aiValidationModal .display-4 {
    font-size: 3rem;
}

#aiValidationModal .card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#aiValidationModal ul {
    margin-bottom: 0;
}

#aiValidationModal li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

#aiValidationModal h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* AI Config refresh animation */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

th.position-relative { 
    position: relative; 
}



/* Fix per btn-outline-secondary in tema dark */
[data-bs-theme="dark"] .btn-outline-secondary {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Simple Round Theme Button */
.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    padding: 0;
    margin: 0;
}

.theme-btn:hover {
    transform: scale(1.05);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.theme-btn .theme-icon {
    transition: all 0.3s ease;
}

.theme-btn:hover .theme-icon {
    transform: rotate(15deg) scale(1.1);
}

/* Dark theme adjustments */
[data-bs-theme="dark"] .theme-btn {
    border-color: var(--bs-gray-600);
    background-color: var(--bs-gray-800);
}

[data-bs-theme="dark"] .theme-btn:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Better spacing */
.navbar .theme-btn {
    margin: 0 8px;
    padding: 0;
}

/* Allinea verticalmente il pulsante con gli altri elementi del navbar */
.navbar-nav .nav-item .theme-btn {
    align-self: center;
}

/* Password Strength Indicator */
.password-strength-wrapper {
    margin-top: 5px;
    flex: 1;
    min-width: 0; /* Permette al flex di ridursi correttamente */
}

.password-strength {
    height: 4px;
    border-radius: 2px;
    background-color: #e9ecef;
    position: relative;
    overflow: hidden;
}

.password-strength::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--strength-width, 0%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.password-strength.strength-weak::before {
    background-color: #dc3545;
}

.password-strength.strength-medium::before {
    background-color: #ffc107;
}

.password-strength.strength-strong::before {
    background-color: #198754;
}

/* Dark theme adjustments for password strength */
/* Table styles for theme support */
[data-bs-theme="dark"] .table {
    --bs-table-bg: #212529;
    --bs-table-striped-bg: #2c3034;
    --bs-table-hover-bg: #343a40;
    --bs-table-border-color: #495057;
    --bs-table-color: #fff;
}

[data-bs-theme="dark"] .table thead th {
    background-color: #343a40;
    border-color: #495057;
    color: #fff;
}

/* Pagination info text theme support */
#paginationInfo {
    color: #212529;
}

[data-bs-theme="dark"] #paginationInfo {
    color: #fff !important;
}

/* Fix text-muted in dark theme */
[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .password-strength {
    background-color: #495057;
}