/* CreativeStudio - Main Styles */
:root {
    --bg-dark: #1e1e1e;
    --bg-medium: #252526;
    --bg-light: #2d2d30;
    --bg-lighter: #3e3e42;
    --bg-hover: #454548;
    --text-primary: #cccccc;
    --text-secondary: #999999;
    --text-bright: #ffffff;
    --accent: #0078d4;
    --accent-hover: #1a8cff;
    --border: #3e3e42;
    --border-light: #555555;
    --danger: #f44336;
    --success: #4caf50;
    --warning: #ff9800;
    --canvas-bg: #1a1a1a;
    --panel-width: 280px;
    --toolbar-width: 42px;
    --menu-height: 30px;
    --options-height: 34px;
    --status-height: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-dark);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    user-select: none;
}

/* Menu Bar */
#menu-bar {
    height: var(--menu-height);
    background: var(--bg-medium);
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.menu-item {
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
}
.menu-item:hover {
    background: var(--bg-hover);
}

.app-title {
    margin-left: auto;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.zoom-controls {
    margin-left: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.zoom-controls button {
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 24px;
    height: 22px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.zoom-controls button:hover {
    background: var(--bg-hover);
}
#zoom-level {
    font-size: 11px;
    min-width: 40px;
    text-align: center;
    color: var(--text-secondary);
}
#btn-zoom-fit {
    width: auto !important;
    padding: 0 8px;
    font-size: 11px;
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: var(--menu-height);
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 4px;
    min-width: 200px;
    padding: 4px 0;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.menu-action {
    padding: 6px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.menu-action:hover {
    background: var(--accent);
    color: var(--text-bright);
}
.menu-action .shortcut {
    color: var(--text-secondary);
    font-size: 10px;
    margin-left: 20px;
}
.menu-action:hover .shortcut {
    color: rgba(255,255,255,0.7);
}
.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

/* Main Container */
#main-container {
    display: flex;
    height: calc(100vh - var(--menu-height) - var(--options-height) - var(--status-height));
}

/* Canvas Container */
#canvas-container {
    flex: 1;
    background: var(--canvas-bg);
    position: relative;
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

#studio-canvas {
    position: absolute;
    touch-action: none;
}

#canvas-container canvas {
    touch-action: none;
}

/* Status Bar */
#status-bar {
    height: var(--status-height);
    background: var(--bg-medium);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 11px;
    color: var(--text-secondary);
    gap: 20px;
}
#status-message {
    margin-left: auto;
    color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Buttons */
.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    width: 100%;
    margin-top: 8px;
}
.primary-btn:hover {
    background: var(--accent-hover);
}
.primary-btn:disabled {
    background: var(--bg-lighter);
    cursor: not-allowed;
}

.secondary-btn {
    background: var(--bg-lighter);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    width: 100%;
}
.secondary-btn:hover {
    background: var(--bg-hover);
}

.small-btn {
    background: var(--bg-lighter);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}
.small-btn:hover {
    background: var(--bg-hover);
}

.toggle-btn {
    background: var(--bg-lighter);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    min-width: 28px;
}
.toggle-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Status text */
.status-text {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    min-height: 16px;
}
.status-text.error { color: var(--danger); }
.status-text.success { color: var(--success); }
.status-text.loading { color: var(--warning); }

.help-text {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Inputs */
input[type="text"],
input[type="number"],
input[type="url"],
select,
textarea {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-family: inherit;
    outline: none;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
}
textarea {
    resize: vertical;
    width: 100%;
}
input[type="color"] {
    width: 32px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    background: none;
}
input[type="range"] {
    -webkit-appearance: none;
    height: 4px;
    background: var(--bg-lighter);
    border-radius: 2px;
    outline: none;
    flex: 1;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

/* Context Menu */
.ctx-action {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}
.ctx-action:hover {
    background: var(--accent);
    color: var(--text-bright);
}
.ctx-action .shortcut {
    color: var(--text-secondary);
    font-size: 10px;
    margin-left: 20px;
}
.ctx-action:hover .shortcut {
    color: rgba(255,255,255,0.7);
}
.ctx-divider {
    height: 1px;
    background: var(--border);
    margin: 3px 0;
}
