:root {
    --accent-color: #3B82F6;
    --global-font: 'Inter', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #020617;
    color: white;
    font-family: var(--global-font);
    overflow: hidden;
    height: 100vh;
}

/* Layouts */
#dashboardView {
    height: 100vh;
    overflow-y: auto;
    background-image: radial-gradient(#0f172a 1.5px, transparent 1.5px);
    background-size: 32px 32px;
    display: flex;
    flex-direction: column;
}

#builderView {
    display: none;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    height: 60px;
    background: rgba(2, 6, 23, 0.95);
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
    z-index: 50;
}

.workspace {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

.sidebar-left {
    width: 280px;
    background: #0f172a;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-right {
    width: 320px;
    background: #0f172a;
    border-left: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.preview-pane {
    flex-grow: 1;
    background: #020617;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-image: radial-gradient(#1e293b 1px, transparent 1px);
    background-size: 30px 30px;
}

.preview-wrapper {
    width: 1200px;
    height: 800px;
    transform-origin: center center;
    position: absolute;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 1);
    border: 1px solid #1e293b;
    border-radius: 1rem;
    overflow: hidden;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 1.2rem;
    width: 1000px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 1);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

/* Form Resets & Select Fixes */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

select option {
    background-color: #0f172a;
    color: #ffffff;
}

/* --- PRO INSPECTOR UI --- */
.prop-panel {
    border-bottom: 1px solid #1e293b;
    padding: 1.25rem 1.25rem;
}

.prop-header {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.prop-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.prop-row-col {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.prop-label {
    font-size: 0.75rem;
    color: #cbd5e1;
    flex: 1;
}

.prop-input {
    background: #020617;
    border: 1px solid #334155;
    color: #f8fafc;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    flex: 1.5;
    width: 100%;
    outline: none;
    transition: all 0.2s;
    font-family: var(--global-font);
}

.prop-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-color) 20%, transparent);
}

textarea.prop-input {
    resize: vertical;
    min-height: 80px;
}

input[type="color"].prop-color {
    -webkit-appearance: none;
    border: none;
    width: 2rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    padding: 0;
    background: transparent;
    flex: none;
}

input[type="color"].prop-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"].prop-color::-webkit-color-swatch {
    border: 1px solid #334155;
    border-radius: 0.25rem;
}

.array-box {
    background: #0b1121;
    border: 1px solid #1e293b;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    position: relative;
    transition: border-color 0.2s;
}

.array-box:hover {
    border-color: #334155;
}

.array-del {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: #ef4444;
    color: white;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    opacity: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.array-box:hover .array-del {
    opacity: 1;
    transform: scale(1.1);
}

.array-del:hover {
    background: #dc2626;
}

.prop-file {
    font-size: 0.65rem;
    color: #94a3b8;
    width: 100%;
    margin-top: 0.25rem;
}

.prop-file::file-selector-button {
    background: #1e293b;
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
    border-radius: 0.25rem;
    color: white;
    border: 1px solid #334155;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 0.5rem;
}

.prop-file::file-selector-button:hover {
    background: #334155;
}

.prop-btn {
    width: 100%;
    background: #1e293b;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.prop-btn:hover {
    background: #334155;
    border-color: #475569;
}

/* Slide List */
.slide-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1e293b;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.slide-item:active {
    cursor: grabbing;
}

.slide-item.active {
    background: #1e293b;
    border-left: 4px solid var(--accent-color);
}

.slide-item:hover:not(.active) {
    background: #1e293b;
    filter: brightness(1.2);
}

.drag-over {
    border-top: 2px solid var(--accent-color);
}

/* Dashboard Cards */
.project-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.8);
}

.deck-preview {
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #334155;
    transition: transform 0.3s;
}

.deck-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, var(--deck-color, #3B82F6) 0%, transparent 60%);
    opacity: 0.2;
    pointer-events: none;
}

.project-card:hover .deck-preview {
    transform: scale(1.02);
}

/* Template Cards */
.template-tab {
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    color: #94a3b8;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.template-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.template-card {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.template-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    background: #223044;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.icon-btn {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1.2rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.icon-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* Tutorial Fixes */
.tut-highlight {
    position: relative;
    z-index: 9999;
    box-shadow: 0 0 0 4px var(--accent-color), 0 0 20px var(--accent-color);
    animation: pulseHighlight 2s infinite;
    border-radius: inherit;
    background-color: inherit;
    pointer-events: none;
}

@keyframes pulseHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.tut-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 10, 0.7);
    z-index: 9998;
    pointer-events: none;
    display: none;
}

.tut-tooltip {
    position: fixed;
    background: #0f172a;
    border: 1px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: 1rem;
    width: 320px;
    z-index: 10000;
    display: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 1);
    color: white;
    transition: top 0.3s, left 0.3s;
    pointer-events: auto;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Themes & Editing */
.theme-slide {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    position: relative;
    pointer-events: auto;
    font-family: var(--global-font);
}

.bg-default {
    background: radial-gradient(circle at 50% 50%, #111827 0%, #000000 100%);
}

.bg-deepblue {
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
}

.bg-midnight {
    background: radial-gradient(circle at 50% 50%, #2e1065 0%, #000000 100%);
}

.bg-pitchblack {
    background: #000000;
}

.bg-purewhite {
    background: #ffffff;
    color: #000000 !important;
}

.theme-card {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid color-mix(in srgb, var(--accent-color) 15%, transparent);
    border-radius: 1.5rem;
    padding: 4rem;
    max-width: 1200px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.bg-purewhite .theme-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.bg-purewhite .text-white {
    color: #000000 !important;
}

.bg-purewhite .text-slate-400 {
    color: #475569 !important;
}

.bg-purewhite .text-slate-300 {
    color: #334155 !important;
}

.bg-purewhite .bg-slate-900 {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

.bg-purewhite .bg-slate-800 {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

.accent-text {
    color: var(--accent-color);
}

[contenteditable="true"] {
    outline: none;
    transition: all 0.2s;
    border-radius: 6px;
    border: 1px dashed transparent;
    position: relative;
    padding: 2px 4px;
    margin: -2px -4px;
    min-width: 20px;
    display: inline-block;
}

[contenteditable="true"]:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    cursor: text;
}

[contenteditable="true"]:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
    z-index: 10;
    cursor: text;
    color: white;
}

.bg-purewhite [contenteditable="true"]:focus {
    background: white;
    color: black;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.exporting [contenteditable="true"] {
    border-color: transparent !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}