/* ============================================
   UTILITIES - Dark Mode Compatible Utility Classes
   ============================================ */

/* Replace inline styles with these utility classes */

/* Section Wrappers */
.section-wrapper-light {
    background: var(--card-secondary);
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

[data-theme="dark"] .section-wrapper-light {
    background: #111827;
    border-color: #2d3748;
}

/* Section Headers */
.section-header {
    margin-top: 0;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.section-header i {
    color: var(--accent);
}

/* Table Styling - Dark Mode Compatible */
.table {
    border-collapse: collapse;
    width: 100%;
}

.table thead th {
    font-weight: 600;
    font-size: 0.9rem;
    background: rgba(31, 182, 255, 0.08);
    color: var(--primary);
    padding: 12px;
}

[data-theme="dark"] .table thead th {
    background: rgba(31, 182, 255, 0.15);
    color: #f8fafb;
}

.table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

[data-theme="dark"] .table tbody tr {
    border-bottom: 1px solid #2d3748;
}

.table tbody tr:hover {
    background: rgba(31, 182, 255, 0.04);
}

[data-theme="dark"] .table tbody tr:hover {
    background: rgba(31, 182, 255, 0.08);
}

.table tbody td {
    padding: 12px;
    color: var(--primary);
}

[data-theme="dark"] .table tbody td {
    color: #e5e7eb;
}

.table-responsive {
    overflow-x: auto;
}

/* Table Bordered */
.table-bordered {
    border: 1px solid var(--border);
}

[data-theme="dark"] .table-bordered {
    border-color: #2d3748;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border);
    padding: 12px;
}

[data-theme="dark"] .table-bordered th,
[data-theme="dark"] .table-bordered td {
    border-color: #2d3748;
}

.table-bordered thead th {
    background: rgba(31, 182, 255, 0.08);
    color: var(--primary);
}

[data-theme="dark"] .table-bordered thead th {
    background: rgba(31, 182, 255, 0.15);
    color: #f8fafb;
}

/* Input Styling - Dark Mode Compatible */
.input-styled {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--primary);
    transition: all var(--transition);
}

[data-theme="dark"] .input-styled {
    background: #1a2332;
    color: #f8fafb;
    border-color: #2d3748;
}

.input-styled:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 182, 255, 0.1);
}

[data-theme="dark"] .input-styled:focus {
    background: #0f1724;
    box-shadow: 0 0 0 3px rgba(31, 182, 255, 0.2);
}

.input-styled::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .input-styled::placeholder {
    color: #6b7280;
}

/* Date/Time Inputs - Dark Mode */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    color-scheme: light;
}

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="week"] {
    color-scheme: dark;
    background: #1a2332;
    color: #f8fafb;
    border-color: #2d3748;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Number Input Spinners */
[data-theme="dark"] input[type="number"]::-webkit-inner-spin-button,
[data-theme="dark"] input[type="number"]::-webkit-outer-spin-button {
    filter: invert(1);
    opacity: 0.7;
}

/* Textarea Styling */
.textarea-styled {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--primary);
    transition: all var(--transition);
}

[data-theme="dark"] .textarea-styled {
    background: #1a2332;
    color: #f8fafb;
    border-color: #2d3748;
}

.textarea-styled:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 182, 255, 0.1);
}

[data-theme="dark"] .textarea-styled:focus {
    background: #0f1724;
    box-shadow: 0 0 0 3px rgba(31, 182, 255, 0.2);
}

[data-theme="dark"] .textarea-styled::placeholder {
    color: #6b7280;
}

/* Label Styling */
.label-with-icon {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--primary);
}

.label-with-icon i {
    margin-right: 8px;
    color: var(--accent);
}

/* Small Helper Text */
.small-muted {
    color: var(--text-secondary);
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
}

[data-theme="dark"] .small-muted {
    color: #9ca3af;
}

/* Range Sliders */
.range-slider {
    width: 100%;
    height: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 4px;
}

.range-slider-energy {
    width: 100%;
    height: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #f59e0b 0%, #fb923c 100%);
    border-radius: 4px;
}

.range-slider-friendliness {
    width: 100%;
    height: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    border-radius: 4px;
}

.range-slider-intelligence {
    width: 100%;
    height: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
    border-radius: 4px;
}

.range-slider-loyalty {
    width: 100%;
    height: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #14b8a6 0%, #06b6d4 100%);
    border-radius: 4px;
}

/* Slider Value Display */
.slider-value-display {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.slider-value-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.slider-value-number {
    font-weight: 600;
    font-size: 1.05rem;
}

.slider-value-energy { color: #f59e0b; }
.slider-value-friendliness { color: #ef4444; }
.slider-value-intelligence { color: #8b5cf6; }
.slider-value-loyalty { color: #14b8a6; }

/* Horizontal Rules */
.hr-styled {
    margin: 40px 0;
    border: 1px solid var(--border);
    opacity: 0.5;
}

[data-theme="dark"] .hr-styled {
    border-color: #2d3748;
}

/* Icon Colors */
.icon-blue { color: #1fb6ff; }
.icon-orange { color: #f97316; }
.icon-yellow { color: #fbbf24; }
.icon-purple { color: #8b5cf6; }
.icon-green { color: #10b981; }
.icon-red { color: #ef4444; }

/* Spacing Utilities */
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

.p-0 { padding: 0; }
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }
.p-40 { padding: 40px; }

/* Display Utilities */
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

/* Flexbox Utilities */
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* Text Utilities */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-weight-500 { font-weight: 500; }
.font-weight-600 { font-weight: 600; }
.font-weight-700 { font-weight: 700; }

.font-size-small { font-size: 0.85rem; }
.font-size-normal { font-size: 0.95rem; }
.font-size-large { font-size: 1.05rem; }

/* Width Utilities */
.w-100 { width: 100%; }
.w-auto { width: auto; }

/* Info Box */
.info-box {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 32px;
    line-height: 1.6;
    padding: 16px;
    background: rgba(31, 182, 255, 0.05);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}

[data-theme="dark"] .info-box {
    background: rgba(31, 182, 255, 0.12);
    color: #9ca3af;
}

.info-box i {
    margin-right: 8px;
    color: var(--accent);
}

.info-box strong {
    color: var(--primary);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .section-wrapper-light {
        padding: 24px;
    }
    
    .section-header {
        font-size: 1rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 8px !important;
    }
}

@media (max-width: 576px) {
    .section-wrapper-light {
        padding: 20px;
    }
    
    .section-header {
        font-size: 0.95rem;
    }
    
    .input-styled,
    .textarea-styled {
        font-size: 0.9rem;
        padding: 12px 14px;
    }
}
