/**
 * Kingbokep - Component Styles
 * Reusable UI components
 */

/* ========================================
   Cards
======================================== */
.card {
    background-color: var(--background-card);
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 15px;
}

.card-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   Forms
======================================== */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.error {
    border-color: var(--error-color);
}

.form-error {
    font-size: 0.75rem;
    color: var(--error-color);
    margin-top: 4px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238a8b91' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* ========================================
   Checkbox & Radio
======================================== */
.checkbox-group,
.radio-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-input,
.radio-input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-label,
.radio-label {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

/* ========================================
   Badges
======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: #000;
}

.badge-error {
    background-color: var(--error-color);
    color: white;
}

/* ========================================
   Tabs
======================================== */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.tab-item {
    padding: 12px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   Dropdown
======================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.dropdown-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.dropdown.active .dropdown-toggle svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    margin-top: 5px;
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow-lg);
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background-color var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-item.active {
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

/* ========================================
   Pagination
======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px 0;
}

.page-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-card);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.page-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.page-item.active {
    background-color: var(--primary-color);
    color: white;
}

.page-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ========================================
   Avatar
======================================== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.8125rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }

/* ========================================
   Empty State
======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 300px;
}

/* ========================================
   Alert
======================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-message {
    font-size: 0.875rem;
}

.alert-success {
    background-color: rgba(0, 200, 83, 0.1);
    border-left: 4px solid var(--success-color);
}

.alert-success .alert-icon { color: var(--success-color); }

.alert-error {
    background-color: rgba(255, 23, 68, 0.1);
    border-left: 4px solid var(--error-color);
}

.alert-error .alert-icon { color: var(--error-color); }

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning-color);
}

.alert-warning .alert-icon { color: var(--warning-color); }

.alert-info {
    background-color: rgba(37, 244, 238, 0.1);
    border-left: 4px solid var(--secondary-color);
}

.alert-info .alert-icon { color: var(--secondary-color); }

/* ========================================
   Tooltip
======================================== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 100;
    margin-bottom: 5px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========================================
   Chip / Tag
======================================== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    transition: background-color var(--transition-fast);
}

.chip:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.chip-close {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.chip-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   Switch Toggle
======================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: 26px;
    transition: background-color var(--transition-fast);
}

.switch-slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.switch input:checked + .switch-slider {
    background-color: var(--primary-color);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(22px);
}

/* ========================================
   Progress
======================================== */
.progress {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.progress-bar.success { background-color: var(--success-color); }
.progress-bar.warning { background-color: var(--warning-color); }
.progress-bar.error { background-color: var(--error-color); }

/* ========================================
   Divider
======================================== */
.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

/* ========================================
   List
======================================== */
.list {
    display: flex;
    flex-direction: column;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.list-item-action {
    flex-shrink: 0;
}

/* ========================================
   Skeleton Loading
======================================== */
.skeleton-video {
    aspect-ratio: 9/16;
    background-color: var(--background-card);
}

.skeleton-text {
    height: 14px;
    border-radius: 4px;
}

.skeleton-text.title {
    width: 70%;
    height: 18px;
}

.skeleton-text.subtitle {
    width: 50%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}
