/* ========================
   GLOBAL & RESET
   ======================== */
body {
    margin: 0;
    overflow: hidden;
    /* Editor needs hidden, Dashboard will override */
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f4f6f8;
    color: #333;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

/* ========================
   SHARED UI COMPONENTS
   ======================== */
/* Buttons */
.primary-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #0056b3;
}

.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.icon-btn {
    background: white;
    border: 1px solid #dce0e5;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #f1f3f5;
    border-color: #c5c9d0;
}

.icon-btn.active {
    background: #e7f1ff;
    color: #007bff;
    border-color: #007bff;
}

.full-btn {
    width: 100%;
    display: block;
    margin-top: 5px;
}

/* Inputs */
input[type="number"],
input[type="text"] {
    border: 1px solid #dce0e5;
    border-radius: 4px;
    padding: 6px;
    font-size: 12px;
    outline: none;
}

input:focus {
    border-color: #007bff;
}

/* ========================
   LANDING & DASHBOARD
   ======================== */
/* Used on index.html and dashboard.html */

.landing-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.type-card {
    border: 2px solid #edf2f7;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    width: 140px;
    text-align: center;
    background: white;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.type-card:hover {
    transform: translateY(-3px);
    border-color: #007bff;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.1);
}

.type-card.selected {
    border-color: #007bff;
    background: #f0f7ff;
}

.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.session-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Modal */
/* #modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
} */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(2px);
}

/* Modal Box */
.modal-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-box h3 { margin-top: 0; margin-bottom: 10px; }

.share-row {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

#shareUrl {
    flex: 1;
    background: #f8f9fa;
    color: #333;
    font-family: monospace;
    border: 1px solid #dce0e5;
}

.text-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
}
.text-btn:hover { color: #333; }
/* ========================
   EDITOR LAYOUT
   ======================== */
#editor-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Panels */
.panel {
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 200px;
    max-width: 600px;
    border-right: 1px solid #dce0e5;
}

#right-panel {
    border-left: 1px solid #dce0e5;
    border-right: none;
}

.panel-header {
    padding: 10px 15px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: #6c757d;
    background: white;
    border-bottom: 1px solid #dce0e5;
}

.panel-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* Resizers */
.resizer-v {
    width: 4px;
    background: #e9ecef;
    cursor: col-resize;
    z-index: 10;
    transition: background 0.2s;
}

.resizer-v:hover {
    background: #007bff;
}

.resizer-h {
    height: 4px;
    background: #e9ecef;
    cursor: row-resize;
    z-index: 10;
    transition: background 0.2s;
}

.resizer-h:hover {
    background: #007bff;
}

/* Hierarchy */
.tree-item {
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
}

.tree-item:hover {
    background: #e9ecef;
}

.tree-item.selected {
    background: #007bff;
    color: white;
}

.tree-icon {
    opacity: 0.7;
    font-size: 14px;
}

/* Viewport */
#viewport {
    flex: 1;
    position: relative;
    background: #e0e0e0;
    min-width: 300px;
}

#viewport canvas {
    outline: none;
}

/* ========================
   EDITOR CONTROLS
   ======================== */
/* Toolbar */
#toolbar {
    height: 50px;
    background: white;
    border-bottom: 1px solid #dce0e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.tool-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Scene Settings */
.control-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.view-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 90px;
    margin: 0 auto 10px auto;
}

.view-grid button {
    padding: 6px 0;
    background: white;
    border: 1px solid #dce0e5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    color: #555;
}

.view-grid button:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.btn-group {
    display: flex;
    gap: 5px;
    width: 100%;
}

.btn-group .icon-btn {
    flex: 1;
    text-align: center;
}

/* Snapping */
.snap-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.snap-row {
    display: flex;
    align-items: center;
    border: 1px solid #dce0e5;
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.snap-toggle {
    flex: 1;
    padding: 6px;
    cursor: pointer;
    background: #f8f9fa;
    border: none;
    border-right: 1px solid #dce0e5;
    font-size: 11px;
    font-weight: 600;
    color: #555;
}

.snap-toggle.active {
    background: #e7f1ff;
    color: #007bff;
}

.snap-input {
    width: 60px;
    text-align: center;
    border: none;
    font-size: 12px;
    outline: none;
}

/* Inspector Inputs */
.prop-group {
    margin-bottom: 15px;
}

.prop-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-row {
    display: flex;
    gap: 5px;
}

.input-row input {
    flex: 1;
    min-width: 0;
    text-align: center;
}

/* ========================
   LOADING & UTILS
   ======================== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.loading-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 300px;
    text-align: center;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #007bff;
    transition: width 0.2s;
}









.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #f2f2f2;
  padding: 20px;
  border-radius: 12px;
  width: 320px;
  color: #242424;
}

.share-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.share-row input {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: none;
}

.share-row button {
  padding: 8px 10px;
  cursor: pointer;
}

.close-btn {
  margin-top: 12px;
  width: fit-content;
  border-radius: 22px;
  padding-inline: 20px;
  margin-inline: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
