/* 
   UI COMPONENTS
   Reusable high-fidelity interface elements.
*/

/* --- CARDS --- */
.card {
    background-color: var(--surface-container);
    border-radius: var(--radius-xl);
    padding: 32px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--surface-container-highest); 
    transition: background-color var(--duration-short);
}

.card-stat {
    background-color: var(--surface-container-low);
    align-items: flex-start;
    justify-content: space-between;
    height: 180px;
    position: relative;
    overflow: hidden;
}

.card-stat::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 120px;
    height: 120px;
    background: var(--primary);
    opacity: 0.05;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.stat-value {
    font-size: 48px;
    font-weight: 600;
    color: var(--on-surface);
    letter-spacing: -1px;
    z-index: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--on-surface-variant);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 1;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.2px;
    transition: all var(--duration-short) var(--spring-easing);
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary);
}
.btn-primary:hover {
    background-color: #D9C8FF;
    box-shadow: 0 2px 8px rgba(208, 188, 255, 0.25);
}

.btn-tonal {
    background-color: var(--secondary-container);
    color: var(--on-secondary-container);
}
.btn-tonal:hover {
    background-color: var(--surface-container-highest);
}

.btn-outline {
    border: 1px solid var(--outline);
    color: var(--primary);
    background-color: transparent;
}
.btn-outline:hover {
    background-color: rgba(208, 188, 255, 0.05);
    border-color: var(--primary);
}

.btn-sm {
    height: 32px;
    padding: 0 16px;
    font-size: 12px;
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* --- FORMS --- */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--on-surface-variant);
    font-size: 13px;
    font-weight: 500;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    height: 52px;
    background-color: var(--surface-container-low);
    border-radius: var(--radius-l);
    padding: 0 16px;
    color: var(--on-surface);
    font-size: 15px;
    border: 1px solid var(--outline-variant);
    transition: all var(--duration-short);
}

.form-control:focus {
    border-color: var(--primary);
    background-color: var(--surface-container);
    box-shadow: 0 0 0 4px rgba(208, 188, 255, 0.1);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

textarea.form-control {
    height: auto;
    padding: 16px;
    font-family: var(--font-mono);
    line-height: 1.6;
    font-size: 13px;
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

/* --- TABLES --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-surface {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    min-width: 600px;
}

.data-surface th {
    text-align: left;
    padding: 12px 24px;
    color: var(--on-surface-variant);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-surface td {
    background-color: var(--surface-container-low);
    padding: 16px 24px;
    color: var(--on-surface);
    font-size: 14px;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s;
}

.data-surface tr td:first-child {
    border-top-left-radius: var(--radius-l);
    border-bottom-left-radius: var(--radius-l);
}

.data-surface tr td:last-child {
    border-top-right-radius: var(--radius-l);
    border-bottom-right-radius: var(--radius-l);
}

.data-surface tr:hover td {
    background-color: var(--surface-container);
}

/* --- BADGES --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background-color: rgba(109, 213, 140, 0.15);
    color: #6DD58C;
    border: 1px solid rgba(109, 213, 140, 0.2);
}

.badge-banned {
    background-color: rgba(242, 184, 181, 0.15);
    color: #F2B8B5;
    border: 1px solid rgba(242, 184, 181, 0.2);
}

/* --- LIST GROUP --- */
.list-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: auto;
}

.list-item {
    padding: 14px 20px;
    border-radius: var(--radius-m);
    color: var(--on-surface-variant);
    transition: all 0.2s;
    font-size: 14px;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
}

.list-item:hover {
    background-color: var(--surface-container-highest);
    color: var(--on-surface);
}

.list-item.active {
    background-color: var(--surface-container-highest);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

/* --- STATE STYLES --- */
.list-item.dimmed {
    opacity: 0.5;
    background-color: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.list-item.dimmed:hover {
    opacity: 0.8;
}

/* --- EDITOR INTEGRATION --- */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--surface-container-low);
    border-bottom: 1px solid var(--outline-variant);
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-s);
    color: var(--on-surface-variant);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.editor-tab:hover {
    background-color: var(--surface-container-highest);
    color: var(--on-surface);
}

.editor-tab.active {
    background-color: var(--secondary-container);
    color: var(--on-secondary-container);
    border-color: transparent;
}

.monaco-wrapper {
    flex-grow: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #1e1e1e;
    font-family: 'JetBrains Mono', 'Consolas', monospace !important;
    font-size: 13px !important;
    letter-spacing: 0 !important;
}

.monaco-wrapper .monaco-editor, 
.monaco-wrapper .monaco-editor .inputarea,
.monaco-wrapper .monaco-editor .view-lines {
    letter-spacing: 0 !important;
    font-feature-settings: "liga" on, "calt" on;
}