/*
 * Theme Overrides - Additional theme-specific styling
 * For randomized themes and special component states
 * ============================================
 */

/* ============================================
   STATUS COMPONENTS (Public/Private, Active/Archived)
   ============================================ */

.status-select.status-active,
.toggle-workflow-public-btn[data-is-public="true"],
.toggle-template-public-btn[data-is-public="true"],
.toggle-public-btn[data-is-public="true"] {
    background-color: var(--status-success) !important;
    border-color: var(--status-success) !important;
    color: white !important;
}

.status-select.status-archived,
.toggle-workflow-public-btn[data-is-public="false"],
.toggle-template-public-btn[data-is-public="false"],
.toggle-public-btn[data-is-public="false"] {
    background-color: var(--text-muted) !important;
    border-color: var(--text-muted) !important;
    color: white !important;
}

.status-select.status-unset {
    color: var(--text-muted) !important;
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    font-weight: normal;
}

/* ============================================
   FORM SELECT DROPDOWN ARROWS
   ============================================ */

/* Light theme dropdown arrows */
.theme-light .form-select,
.theme-light select.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234A5568' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
}

/* Dark theme dropdown arrows */
.theme-dark .form-select,
.theme-dark select.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23CBD5E1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
}

/* ============================================
   RADIO AND CHECKBOX STYLING
   ============================================ */

/* Light mode */
.theme-light .form-check-input[type="radio"]:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.theme-light .form-check-input[type="checkbox"]:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Dark mode */
.theme-dark .form-check-input[type="radio"]:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.theme-dark .form-check-input[type="checkbox"]:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ============================================
   ADMIN DASHBOARD CARDS
   ============================================ */

.admin-dashboard-card {
    border: 1px solid var(--border-default);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    color: white;
}

.admin-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.admin-dashboard-card.users-card {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
}

.admin-dashboard-card.workflows-card {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.admin-dashboard-card.prompt-lists-card {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.admin-dashboard-card.public-lists-card {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.admin-dashboard-card .card-title {
    font-weight: 600;
}

.admin-dashboard-card .display-4 {
    font-weight: 700;
}

/* ============================================
   RANDOMIZED THEME SUPPORT
   ============================================ */

/* Base randomized theme class */
body.theme-randomized {
    background-color: var(--bg-primary);
}

body.theme-randomized .main-wrapper {
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-elev-2));
}

/* Component overrides for randomized theme */
.theme-randomized .card,
.theme-randomized .card-body,
.theme-randomized .modal-content,
.theme-randomized .dropdown-menu,
.theme-randomized .list-group-item,
.theme-randomized .tab-content,
.theme-randomized .table {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.theme-randomized .card-header,
.theme-randomized .modal-header,
.theme-randomized .table thead th,
.theme-randomized .top-header,
.theme-randomized .sidebar,
.theme-randomized input,
.theme-randomized textarea,
.theme-randomized select:not(.status-select),
.theme-randomized .form-control,
.theme-randomized .form-select:not(.status-select) {
    background-color: var(--bg-elev-1);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.theme-randomized .table tbody td,
.theme-randomized .table tbody tr {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Preserve status colors in randomized theme */
.theme-randomized .status-select.status-active {
    background-color: #16A34A !important;
    border-color: #16A34A !important;
    color: white !important;
}

.theme-randomized .status-select.status-archived {
    background-color: #6B7280 !important;
    border-color: #6B7280 !important;
    color: white !important;
}

.theme-randomized .status-select.status-unset {
    background-color: var(--bg-elev-1) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}

.theme-randomized .text-muted {
    color: var(--text-muted) !important;
}

.theme-randomized .text-secondary {
    color: var(--text-secondary) !important;
}

/* Nav tabs in randomized theme */
.theme-randomized .nav-tabs .nav-link.active {
    color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, color-mix(in srgb, var(--accent-primary) 10%, var(--bg-card)) 100%);
    border-color: var(--accent-primary) var(--accent-primary) var(--bg-card);
}

/* Dropdown arrows in randomized theme */
.theme-light.theme-randomized .form-select,
.theme-light.theme-randomized select.form-select {
    background-color: var(--bg-elev-1);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.theme-dark.theme-randomized .form-select,
.theme-dark.theme-randomized select.form-select {
    background-color: var(--bg-elev-1);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23E0E0E0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Bootstrap variable overrides for randomized theme */
.theme-randomized {
    --bs-body-bg: var(--bg-primary);
    --bs-body-color: var(--text-primary);
    --bs-border-color: var(--border-color);
    --bs-table-bg: var(--bg-card);
    --bs-table-color: var(--text-primary);
}

/* ============================================
   BOOTSTRAP UTILITY OVERRIDES
   ============================================ */

/* Background utilities that need theme awareness */
.theme-randomized .bg-white,
.theme-randomized .bg-light,
.theme-randomized .bg-body {
    background-color: var(--bg-card) !important;
}

/* Text utilities */
.theme-randomized .text-dark {
    color: var(--text-primary) !important;
}

/* ============================================
   MOBILE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .admin-dashboard-card {
        margin-bottom: var(--space-4);
    }
    
    .admin-dashboard-card .display-4 {
        font-size: 2rem;
    }
}
