/* ============================================
   Play Store Screenshot Studio - Main Stylesheet
   ============================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #0f0f14;
    --bg-secondary: #1a1a24;
    --bg-tertiary: #242432;
    --bg-card: #1e1e2a;
    --bg-hover: #2a2a3a;
    --bg-input: #16161f;
    --text-primary: #e8e8f0;
    --text-secondary: #9090a8;
    --text-muted: #606078;
    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-light: rgba(108, 92, 231, 0.15);
    --accent-glow: rgba(108, 92, 231, 0.3);
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --danger-hover: #e8593c;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --nav-height: 56px;
    --sidebar-width: 260px;
}

/* === Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: var(--font);
    cursor: pointer;
    border: none;
    outline: none;
}

input, select, textarea {
    font-family: var(--font);
    outline: none;
}

/* === Top Navigation === */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
}

.nav-logo i {
    color: var(--accent);
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.92rem;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-logout {
    color: var(--text-muted) !important;
    font-size: 1.1rem;
}

.nav-logout:hover {
    color: var(--danger) !important;
}

/* === Auth Pages === */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition);
}

.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-form .form-error {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 6px;
    display: none;
}

.auth-form .form-error.visible {
    display: block;
}

.auth-form .btn-primary {
    width: 100%;
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.auth-footer a {
    font-weight: 600;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    transition: all var(--transition);
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

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

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

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

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* === Main Content === */
main {
    padding-top: var(--nav-height);
    min-height: 100vh;
}

.auth-page main {
    padding-top: 0;
}

/* === Dashboard === */
.dashboard {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.dashboard-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--accent-light);
    color: var(--accent);
}

.stat-card .stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card .stat-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

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

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

/* === Project Grid === */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
}

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

.project-card-thumb {
    width: 100%;
    height: 180px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.project-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-thumb .placeholder-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.project-card-info {
    padding: 16px;
}

.project-card-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-info .project-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.project-card-actions {
    display: flex;
    gap: 8px;
}

.project-card-actions .btn {
    flex: 1;
}

.new-project-card {
    border-style: dashed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    background: transparent;
}

.new-project-card:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}

.new-project-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.new-project-card span {
    font-weight: 600;
    color: var(--text-secondary);
}

/* === Sidebar === */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--nav-height);
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 0.92rem;
}

/* === Sidebar Navigation === */
.sidebar-nav {
    position: fixed;
    left: 0;
    top: var(--nav-height);
    bottom: 0;
    width: 56px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    gap: 4px;
    z-index: 200;
}

.sidebar-nav-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.sidebar-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-nav-item .tooltip {
    position: absolute;
    left: 52px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.sidebar-nav-item:hover .tooltip {
    opacity: 1;
}

/* === Editor Layout === */
.editor-layout {
    display: flex;
    height: calc(100vh - var(--nav-height));
    overflow: hidden;
}

.editor-left {
    width: 280px;
    min-width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-center {
    flex: 1;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.editor-right {
    width: 300px;
    min-width: 300px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === Editor Toolbar (Top) === */
.editor-toolbar {
    height: 44px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 4px;
    flex-shrink: 0;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.92rem;
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
    border: none;
}

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

.toolbar-btn.active {
    background: var(--accent-light);
    color: var(--accent);
}

.toolbar-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 6px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-spacer {
    flex: 1;
}

.toolbar-zoom {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}

.toolbar-zoom span {
    min-width: 45px;
    text-align: center;
}

/* === Canvas Workspace === */
.canvas-workspace {
    flex: 1;
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(45deg, #1a1a24 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a24 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a24 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a24 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #14141c;
}

.canvas-container {
    position: absolute;
    transform-origin: 0 0;
}

.canvas-wrapper {
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

#main-canvas {
    display: block;
    background: #ffffff;
}

/* === Editor Status Bar === */
.editor-statusbar {
    height: 28px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    gap: 16px;
    flex-shrink: 0;
}

.statusbar-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* === Tools Panel === */
.tools-panel {
    padding: 12px;
}

.tool-group {
    margin-bottom: 16px;
}

.tool-group-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    padding: 0 4px;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
    border: none;
    text-align: left;
}

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

.tool-btn.active {
    background: var(--accent-light);
    color: var(--accent);
}

.tool-btn i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

/* === Properties Panel === */
.properties-panel {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.prop-section {
    margin-bottom: 16px;
}

.prop-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.prop-section-header:hover {
    background: var(--bg-hover);
}

.prop-section-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.prop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.prop-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    min-width: 40px;
    flex-shrink: 0;
}

.prop-input {
    flex: 1;
    padding: 6px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: border-color var(--transition);
}

.prop-input:focus {
    border-color: var(--accent);
}

.prop-input-sm {
    width: 60px;
    flex: none;
}

.prop-color {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    cursor: pointer;
    padding: 0;
}

.prop-color::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.prop-color::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

/* === Layers Panel === */
.layers-panel {
    flex: 1;
    overflow-y: auto;
}

.layers-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.layers-list {
    padding: 4px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    margin-bottom: 2px;
}

.layer-item:hover {
    background: var(--bg-hover);
}

.layer-item.selected {
    background: var(--accent-light);
    border-color: var(--accent);
}

.layer-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.layer-thumb i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.layer-info {
    flex: 1;
    min-width: 0;
}

.layer-name {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-type {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.layer-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.layer-item:hover .layer-actions {
    opacity: 1;
}

.layer-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.layer-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.layer-action-btn.danger:hover {
    background: rgba(225, 112, 85, 0.2);
    color: var(--danger);
}

/* === Pages Panel === */
.pages-panel {
    border-top: 1px solid var(--border);
}

.pages-list {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    overflow-x: auto;
}

.page-thumb {
    width: 48px;
    height: 84px;
    border-radius: 4px;
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
    flex-shrink: 0;
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--transition);
    position: relative;
}

.page-thumb.active {
    border-color: var(--accent);
}

.page-thumb:hover {
    border-color: var(--border-light);
}

.page-thumb-number {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
}

.add-page-btn {
    width: 48px;
    height: 84px;
    border-radius: 4px;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    background: transparent;
}

.add-page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* === Modals === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.2s;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
    border: none;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* === Form Elements in Modal === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.92rem;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

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

/* === Preset Grid === */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.preset-item {
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.preset-item:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.preset-item.active {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.preset-item .preset-preview {
    width: 40px;
    height: 60px;
    margin: 0 auto 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
}

.preset-item .preset-name {
    font-weight: 500;
}

.preset-item .preset-size {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

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

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

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

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

.toast i {
    font-size: 1.1rem;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--accent); }

.toast-message {
    flex: 1;
    font-size: 0.88rem;
}

.toast-close {
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    padding: 4px;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === Tabs === */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
}

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

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

/* === Color Swatches === */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--accent);
}

/* === Templates Grid === */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.template-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}

.template-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.template-preview {
    width: 100%;
    height: 140px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-info {
    padding: 10px 12px;
}

.template-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.template-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === Export Panel === */
.export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.export-option {
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.export-option:hover {
    border-color: var(--accent);
}

.export-option.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.export-option i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--accent);
}

.export-option h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.export-option p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* === Footer === */
.site-footer {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}

/* === Empty States === */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.88rem;
    margin-bottom: 20px;
}

/* === Loading Spinner === */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 24px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Responsive === */
@media (max-width: 768px) {
    .dashboard {
        padding: 16px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .auth-container {
        padding: 24px;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .editor-left,
    .editor-right {
        position: absolute;
        z-index: 500;
        height: calc(100vh - var(--nav-height));
    }
    
    .editor-left {
        left: 0;
        width: 280px;
    }
    
    .editor-right {
        right: 0;
        width: 280px;
    }
}

@media (max-width: 480px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
    
    .modal {
        width: 95%;
    }
}

/* === Editor Nav === */
.editor-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.editor-nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-title {
    font-weight: 600;
    font-size: 0.95rem;
}

/* === Context Menu === */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    min-width: 180px;
    padding: 4px;
    display: none;
}

.context-menu.visible {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.context-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.context-menu-item.danger {
    color: var(--danger);
}

.context-menu-item.danger:hover {
    background: rgba(225, 112, 85, 0.15);
}

.context-menu-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

/* === Range Slider === */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
}

/* === Checkbox === */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.checkbox-wrapper input:checked + .checkbox-mark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-wrapper input:checked + .checkbox-mark::after {
    content: '✓';
    color: #fff;
    font-size: 0.7rem;
}

.checkbox-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* === Tab Panel === */
.tab-panel {
    display: none;
}

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

/* === Gradient Editor === */
.gradient-bar {
    width: 100%;
    height: 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

/* === Safe Area Guides === */
.safe-area-overlay {
    position: absolute;
    border: 1px dashed rgba(255, 255, 0, 0.3);
    pointer-events: none;
    z-index: 10;
}

/* === Drag overlay === */
.drag-over {
    border: 2px dashed var(--accent) !important;
    background: var(--accent-light) !important;
}

/* === Progress Bar === */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* === Overlay for page body === */
body.editor-page {
    overflow: hidden;
}

body.editor-page .top-nav {
    display: none;
}

body.editor-page main {
    padding-top: 0;
}
