/**
 * superadmin-license styles (Wave D4)
 * Extracted from root styles.css.
 */

/* --- from styles.css L9497-L9794 --- */
/* ========================================
   Module License Modal (Superadmin)
   ======================================== */

.module-license-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.module-tier-section {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    background: var(--bg-surface-2, #1e1e1e);
}

.module-tier-section.module-tier-future {
    opacity: 0.6;
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

.tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.tier-0 {
    background: var(--success-color, #98c379);
    color: #121212;
}

.tier-badge.tier-1 {
    background: var(--brand-color, #0D3B66);
    color: #121212;
}

.tier-badge.tier-2 {
    background: var(--purple-color, #c678dd);
    color: #121212;
}

.tier-badge.tier-3 {
    background: var(--warning-color, #e5c07b);
    color: #121212;
}

.module-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface-1, #121212);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.module-item i {
    font-size: 1.2rem;
    color: var(--brand-fg, var(--brand-color));
    flex-shrink: 0;
}

.module-item span:first-of-type:not(.module-status):not(.toggle-slider) {
    flex: 1;
}

.module-item.module-locked {
    cursor: default;
    opacity: 0.9;
}

.module-item.module-locked .module-status.active {
    color: var(--success-text, var(--success-color));
    font-weight: bold;
}

.module-item.module-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.module-item.module-disabled .module-status.soon {
    font-size: 1rem;
}

/* Toggle Switch Style */
.module-item.module-toggleable {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.module-item.module-toggleable:hover {
    border-color: var(--brand-color);
    background: rgba(var(--brand-color-rgb), 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Status background berdasarkan aktif/nonaktif */
.module-item.module-toggleable {
    background: var(--bg-surface-1, #121212);
    border-color: rgba(255, 255, 255, 0.1);
}

.module-item.module-toggleable input.module-switch:checked ~ span:first-of-type {
    color: var(--brand-fg, var(--brand-color));
    font-weight: 600;
}

.module-item.module-toggleable input.module-switch:not(:checked) ~ span:first-of-type {
    color: var(--text-secondary);
    opacity: 0.6;
}

.module-item.module-toggleable input.module-switch:not(:checked) ~ i {
    opacity: 0.5;
    color: var(--text-secondary) !important;
}

.module-item.module-toggleable input.module-switch {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.module-item.module-toggleable .toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.module-item.module-toggleable .toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #666;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Status AKTIF */
.module-item.module-toggleable input.module-switch:checked + .toggle-slider {
    background: var(--brand-color);
    box-shadow: 0 0 8px rgba(var(--brand-color-rgb), 0.4);
    animation: pulse-active 0.5s ease-out;
}

@keyframes pulse-active {
    0% {
        box-shadow: 0 0 0 rgba(var(--brand-color-rgb), 0.4);
    }
    50% {
        box-shadow: 0 0 12px rgba(var(--brand-color-rgb), 0.6);
    }
    100% {
        box-shadow: 0 0 8px rgba(var(--brand-color-rgb), 0.4);
    }
}

.module-item.module-toggleable input.module-switch:checked + .toggle-slider::after {
    transform: translateX(18px);
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.module-item.module-toggleable:has(input.module-switch:checked) {
    border-color: var(--brand-color);
    background: rgba(var(--brand-color-rgb), 0.08);
}

/* Status NONAKTIF - lebih redup */
.module-item.module-toggleable:has(input.module-switch:not(:checked)) {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Status Text Label */
.module-item .module-status-text {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* NONAKTIF state */
.module-item.module-toggleable input.module-switch:not(:checked) ~ .module-status-text {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.module-item.module-toggleable input.module-switch:not(:checked) ~ .module-status-text::before {
    content: 'NONAKTIF';
}

/* AKTIF state */
.module-item.module-toggleable input.module-switch:checked ~ .module-status-text {
    background: var(--success-color);
    color: #121212;
}

.module-item.module-toggleable input.module-switch:checked ~ .module-status-text::before {
    content: 'AKTIF';
}

.module-item.module-toggleable.module-dep-warning {
    border-color: var(--warning-color);
}

.module-item .dep-hint {
    display: none;
    position: absolute;
    bottom: -18px;
    left: 0;
    font-size: 0.7rem;
    color: var(--warning-text, var(--warning-color));
}

.module-item.module-toggleable.show-dep-hint .dep-hint {
    display: block;
}

/* Impact Summary */
.impact-summary {
    background: var(--warning-bg, rgba(229, 192, 123, 0.1));
    border-left: 4px solid var(--warning-color, #e5c07b);
}

.impact-summary h5 {
    color: var(--warning-text, var(--warning-color));
}

.impact-summary ul {
    color: var(--text-secondary);
}

.impact-summary ul li {
    margin-bottom: 4px;
}

.impact-summary .impact-add {
    color: var(--success-text, var(--success-color));
}

.impact-summary .impact-remove {
    color: var(--error-text, var(--error-color));
}

/* Responsive */
@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .module-items {
        grid-template-columns: 1fr;
    }

    .tier-header {
        flex-wrap: wrap;
    }

    #super-module-license-modal .modal-content {
        padding: 16px;
    }
}

