/* Spin Wheel Playable Studio Editor Styling — Minimalist Black & White Theme */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #0b0f19;
    --bg-panel: #111827;
    --bg-card: #1f293d;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #4f46e5;
    --text-light: #f3f4f6;
    --text-muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.08);
    --sidebar-width: 440px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
}

#studio-app {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
}

/* Header Action Bar */
#studio-header {
    height: 60px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: #18181b;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #3f3f46;
}

.brand-titles h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-light);
}

.brand-badge {
    font-size: 11px;
    font-weight: 700;
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Header Size Meter Badge */
.header-size-meter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #f4f4f5;
}

.meter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e; /* Green ok */
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
.meter-dot.warn {
    background-color: #eab308;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}
.meter-dot.danger {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

/* Real-Time Bundle Meter Card in MRAID Tab */
.bundle-meter-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meter-title {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.meter-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}
.meter-status-badge.status-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.meter-status-badge.status-warn {
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.3);
}
.meter-status-badge.status-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.meter-bar-container {
    width: 100%;
    height: 10px;
    background: #27272a;
    border-radius: 5px;
    overflow: hidden;
}

.meter-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    transition: width 0.4s ease, background 0.4s ease;
    border-radius: 5px;
}
.meter-bar-fill.warn {
    background: linear-gradient(90deg, #eab308 0%, #ca8a04 100%);
}
.meter-bar-fill.danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.meter-footer-text {
    font-size: 11px;
    color: var(--text-muted);
}

.meter-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: #09090b;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #27272a;
}

.meter-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meter-stat .stat-lbl {
    font-size: 10px;
    color: #a1a1aa;
    font-weight: 600;
}

.meter-stat .stat-num {
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #4f46e5;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
    background-color: #4338ca;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.device-btn.active {
    background-color: #4f46e5;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

.btn-file-input {
    position: relative;
    cursor: pointer;
}

/* Main Studio Layout */
#studio-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Left Sidebar */
#studio-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.studio-tabs {
    display: flex;
    flex-wrap: wrap;
    background-color: #09090b;
    border-bottom: 1px solid var(--border);
    padding: 6px;
    gap: 4px;
}

.tab-btn {
    flex: 1 1 30%;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    color: var(--text-light);
    background: rgba(255,255,255,0.06);
}

.tab-btn.active {
    background-color: #18181b;
    color: #ffffff;
    border-color: #3f3f46;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.tab-contents {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

.section-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-light);
}

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.subsection-title {
    font-size: 14px;
    font-weight: 700;
    margin: 20px 0 10px 0;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--primary);
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border 0.2s ease;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
}

.form-color {
    width: 100%;
    height: 38px;
    padding: 4px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.form-help {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.range-with-val {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-range {
    flex: 1;
    accent-color: var(--primary);
    cursor: pointer;
}

.range-badge {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    min-width: 60px;
    text-align: center;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Theme Cards Grid */
.themes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.theme-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-card:hover {
    border-color: var(--primary);
    background: rgba(233, 30, 99, 0.08);
    transform: translateX(2px);
}

.theme-card.active {
    border-color: var(--primary);
    background: rgba(233, 30, 99, 0.12);
    box-shadow: 0 0 12px rgba(233, 30, 99, 0.35);
}

.theme-card-visual {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-card-visual svg {
    width: 56px;
    height: 56px;
    display: block;
}

.theme-card-labels {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.theme-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-light);
    line-height: 1.2;
}

.theme-type-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(233, 30, 99, 0.15);
    border: 1px solid rgba(233, 30, 99, 0.3);
    border-radius: 4px;
    padding: 1px 5px;
    display: inline-block;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Slice List Cards */
.slices-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.slice-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.slice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.slice-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
}

.btn-remove-slice {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
}

/* Asset Cards */
.asset-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.asset-info {
    display: flex;
    flex-direction: column;
}

.asset-name {
    font-size: 13px;
    font-weight: 700;
}

.asset-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.asset-preview-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.asset-img-thumb {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background-color: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 2px;
    border: 1px solid var(--border);
}

/* Right Main Live Preview Container */
#studio-preview-container {
    flex: 1;
    background-color: #0b1329;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#preview-toolbar {
    width: 100%;
    height: 50px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.device-selector {
    display: flex;
    background-color: var(--bg-dark);
    padding: 3px;
    border-radius: 6px;
    gap: 4px;
}

.device-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.device-btn.active {
    background-color: var(--bg-card);
    color: var(--text-light);
}

.toolbar-right {
    display: flex;
    gap: 8px;
}

/* Preview Viewport Wrapper */
#preview-viewport-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#preview-viewport-wrapper.device-mobile-portrait #preview-iframe {
    height: 95%;
    max-height: 667px;
    aspect-ratio: 375 / 667;
    width: auto;
    max-width: 100%;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 10px #1e293b;
}

#preview-viewport-wrapper.device-mobile-landscape #preview-iframe {
    width: 95%;
    max-width: 667px;
    aspect-ratio: 667 / 375;
    height: auto;
    max-height: 100%;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 10px #1e293b;
}

#preview-viewport-wrapper.device-desktop #preview-iframe {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

#preview-iframe {
    background-color: #0f172a;
    transition: all 0.3s ease;
}

/* Footer Stats */
#preview-footer-stats {
    height: 36px;
    width: 100%;
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    gap: 10px;
    font-size: 12px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-badge {
    background-color: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-box {
    width: 440px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.success-icon-box {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-success-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: center;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.stat-val {
    font-weight: 800;
    color: var(--primary);
}

.compliance-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-top: 20px;
}

.compliance-box h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-light);
}

.network-list {
    list-style: none;
    font-size: 12px;
    color: var(--text-muted);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.check-icon {
    color: #4caf50;
    font-weight: 900;
    margin-right: 4px;
}

.hidden {
    display: none !important;
}
