/* ============================================
   SIMS 4 CC CREATOR — Components
   Reusable UI components
   ============================================ */

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-plumbob);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 16px rgba(57, 181, 74, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 24px rgba(57, 181, 74, 0.3);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--surface-border);
}

.btn-secondary:hover {
    border-color: var(--surface-border-hover);
    background: var(--bg-glass-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

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

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-icon.active {
    background: rgba(57, 181, 74, 0.15);
    color: var(--plumbob-green-light);
    border-color: rgba(57, 181, 74, 0.3);
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.card:hover {
    border-color: var(--surface-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
}

.card-body {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.card-footer {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Feature Card */
.feature-card {
    cursor: pointer;
    text-align: center;
    padding: var(--space-xl);
}

.feature-card .feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    margin: 0 auto var(--space-md);
    background: rgba(57, 181, 74, 0.1);
    border: 1px solid rgba(57, 181, 74, 0.2);
}

.feature-card .feature-title {
    font-family: var(--font-display);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.feature-card .feature-desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--plumbob-green);
    box-shadow: 0 0 0 3px rgba(57, 181, 74, 0.15);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

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

/* Range Slider */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--plumbob-green);
    cursor: pointer;
    box-shadow: 0 0 8px var(--plumbob-glow);
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.color-picker-swatch {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 2px solid var(--surface-border);
    cursor: pointer;
    overflow: hidden;
}

.color-picker-swatch input[type="color"] {
    width: 150%;
    height: 150%;
    border: none;
    cursor: pointer;
    margin: -25%;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
}

.badge-success {
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.2);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
    border-color: rgba(251, 191, 36, 0.2);
}

.badge-info {
    background: rgba(91, 168, 232, 0.1);
    color: var(--info);
    border-color: rgba(91, 168, 232, 0.2);
}

.badge-accent {
    background: rgba(57, 181, 74, 0.1);
    color: var(--plumbob-green-light);
    border-color: rgba(57, 181, 74, 0.2);
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
}

.tab {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    font-family: var(--font-primary);
}

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

.tab.active {
    background: var(--bg-elevated);
    color: var(--plumbob-green-light);
    box-shadow: var(--shadow-sm);
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: toastIn 0.3s ease forwards;
    backdrop-filter: blur(12px);
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--error);
}

.toast-info {
    border-left: 3px solid var(--info);
}

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: var(--text-lg);
    padding: 0;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--surface-overlay);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--text-lg);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    border-color: var(--surface-border-hover);
}

/* ---- Tooltip ---- */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-md);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--text-tertiary);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state .empty-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state .empty-desc {
    font-size: var(--text-sm);
    max-width: 400px;
    margin: 0 auto var(--space-lg);
}

/* ---- Toolbar ---- */
.toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--surface-border);
    margin: 0 var(--space-xs);
}

/* ---- Progress ---- */
.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-plumbob);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}