/**
 * GEOZONES HIERARCHICAL UI
 * Styles for expandable/collapsible zone categories
 */

/* Category container */
.zone-category {
    margin-bottom: 0.75rem;
}

/* Category header (clickable) */
.category-header {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.category-header:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.category-header.active {
    background-color: #e0f2fe;
    border-color: #0ea5e9;
}

/* Expand/collapse icon */
.category-icon {
    margin-right: 0.5rem;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.category-header.expanded .category-icon {
    transform: rotate(90deg);
}

/* Category title */
.category-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Category count badge */
.category-count {
    background-color: #64748b;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Category content (collapsible) */
.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 1.25rem;
}

.category-content.expanded {
    max-height: 1000px;
    margin-top: 0.5rem;
}

/* Subcategory checkbox */
.subcategory-item {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s;
}

.subcategory-item:hover {
    background-color: #f8fafc;
}

.subcategory-checkbox {
    margin-right: 0.5rem;
    cursor: pointer;
}

.subcategory-label {
    flex: 1;
    font-size: 0.8125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.subcategory-icon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

.subcategory-text {
    flex: 1;
}

.subcategory-count {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-left: 0.25rem;
}

/* Legend color boxes */
.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Loading state */
.geozones-controls.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Status messages */
.zone-status {
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
}

.zone-status.success {
    background-color: #d1fae5;
    color: #065f46;
}

.zone-status.error {
    background-color: #fee2e2;
    color: #991b1b;
}

.zone-status.info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Master checkbox */
.master-checkbox {
    display: flex;
    align-items: center;
    padding: 0.625rem;
    background-color: #f1f5f9;
    border: 2px solid #cbd5e1;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.master-checkbox input {
    margin-right: 0.625rem;
    width: 16px;
    height: 16px;
}

.master-checkbox label {
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

[data-theme="dark"] .category-header {
    background-color: #0f172a;
    border-color: #334155;
    color: #ffffff !important;
}

[data-theme="dark"] .category-title {
    color: #ffffff !important;
}

[data-theme="dark"] .category-header:hover {
    background-color: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .category-header.active {
    background-color: #1e3a8a;
    border-color: #3b82f6;
}

[data-theme="dark"] .category-count {
    background-color: #475569;
    color: #ffffff !important;
}

[data-theme="dark"] .subcategory-item:hover {
    background-color: #0f172a;
}

[data-theme="dark"] .subcategory-label {
    color: #ffffff !important;
}

[data-theme="dark"] .subcategory-text {
    color: #ffffff !important;
}

[data-theme="dark"] .subcategory-count {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .zone-status.success {
    background-color: #064e3b;
    color: #a7f3d0;
}

[data-theme="dark"] .zone-status.error {
    background-color: #7f1d1d;
    color: #fecaca;
}

[data-theme="dark"] .zone-status.info {
    background-color: #1e3a8a;
    color: #bfdbfe;
}

[data-theme="dark"] .master-checkbox {
    background-color: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}
