/* ==========================================================================
   UWS Slide - Modern Presentation Editor Stylesheet
   Crafted by Designer-Delta (Lead UI/UX & Creative Director)
   ========================================================================== */

/* --- Typography Imports --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Design Tokens & Variables --- */
:root {
    /* Color Palette - Modern & Clean */
    --bg-workspace: #f4f7f9; /* Soft cool gray for workspace */
    --bg-panel: #ffffff; /* Crisp white for panels */
    --bg-panel-hover: #f8fafc;
    
    --primary-color: #2563eb; /* Modern Indigo/Blue */
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.2);
    
    --text-main: #0f172a; /* Slate 900 */
    --text-muted: #64748b; /* Slate 500 */
    --text-light: #94a3b8; /* Slate 400 */
    
    --border-color: #e2e8f0; /* Slate 200 */
    --border-light: #f1f5f9; /* Slate 100 */

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Glassmorphism & Materials */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(16px);
    
    /* Shadows - Deep & Diffused */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-canvas: 0 20px 40px -8px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.02);
    --shadow-glass: 0 8px 32px rgba(15, 23, 42, 0.08);

    /* Animation Easing */
    --ease-spring: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: 0.15s var(--ease-spring);
    --transition-normal: 0.25s var(--ease-spring);
}

/* --- Resets & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-panel);
    color: var(--text-main);
    overflow: hidden;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* --- Application Layout --- */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: var(--bg-workspace);
}

/* =========================================
   1. Top Navbar & Toolbar
   ========================================= */
#top-navbar {
    height: 64px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-left, .nav-center, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Logo */
#logo-container {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    cursor: pointer;
}

#logo-container:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* Document Title */
.title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

#presentation-title {
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    background: transparent;
    padding: 2px 8px;
    border-radius: 6px;
    width: 260px;
    transition: all var(--transition-fast);
    outline: none;
    margin-left: -8px; /* Optically align with menu */
}

#presentation-title:hover {
    background: var(--bg-panel-hover);
    border-color: var(--border-color);
}

#presentation-title:focus {
    background: var(--bg-panel);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Menu Bar */
.menu-bar {
    display: flex;
    gap: 2px;
}

.menu-item {
    background: transparent;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.menu-item:hover {
    background: var(--border-light);
    color: var(--text-main);
}

/* Center Toolbar */
.toolbar-group {
    display: flex;
    gap: 4px;
    background: var(--bg-panel-hover);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.tool-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.tool-btn:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.tool-btn.active {
    background: var(--primary-light);
    color: var(--primary-color);
    box-shadow: inset 0 0 0 1px var(--primary-glow);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

/* Right Actions */
.action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.secondary-btn {
    background: var(--primary-light);
    color: var(--primary-color);
}

.secondary-btn:hover {
    background: #dbeafe; /* Blue 100 */
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--bg-panel);
    box-shadow: 0 0 0 2px var(--border-color);
    cursor: pointer;
    transition: transform var(--transition-normal);
}

.user-avatar img:hover {
    transform: scale(1.05);
}

/* =========================================
   2. Main Content Wrapper
   ========================================= */
#main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* =========================================
   3. Left Sidebar (Thumbnails)
   ========================================= */
#left-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

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

.add-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg-panel);
    border: 1px dashed var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.add-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#slide-list {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slide-thumbnail-container {
    display: flex;
    gap: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--transition-normal);
    align-items: flex-start;
}

.slide-thumbnail-container:hover {
    opacity: 1;
    transform: translateX(2px);
}

.slide-thumbnail-container.active {
    opacity: 1;
}

.slide-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    width: 16px;
    text-align: right;
}

.slide-thumbnail {
    flex: 1;
    aspect-ratio: 16/9;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.slide-thumbnail-container.active .slide-thumbnail {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.thumb-content {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    pointer-events: none;
}

.thumb-content.blank {
    background: var(--bg-panel-hover);
    border: 1px dashed var(--border-color);
}

.thumb-title {
    font-size: 8px;
    font-weight: 600;
    text-align: center;
    padding: 4px;
    color: var(--text-main);
}

.empty-icon {
    color: var(--text-light);
    font-size: 14px;
}

/* =========================================
   4. Workspace & Canvas Area
   ========================================= */
#workspace {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Premium Editor Dot Matrix Background */
    background-color: var(--bg-workspace);
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 24px 24px;
}

#canvas-wrapper {
    width: 70%;
    max-width: 1440px;
    aspect-ratio: 16/9;
    position: relative;
    border-radius: 12px;
    box-shadow: var(--shadow-canvas);
    transition: transform var(--ease-out) 0.3s;
    transform-origin: center center;
}

/* Canvas Styling */
#presentation-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.8);
}

/* Glassmorphism Optional Variant (If requested by user to be strictly glass) */
#presentation-canvas.glass-canvas {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

/* Canvas Elements (Text, Shapes, etc.) */
.canvas-element {
    position: absolute;
    border: 2px solid transparent;
    cursor: move;
    border-radius: 8px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.canvas-element:hover {
    border-color: rgba(148, 163, 184, 0.4); /* Slate 400 with opacity */
}

.canvas-element.selected-element {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.02); /* Extremely subtle fill when active */
}

/* Editable Text Content Alignment */
.canvas-element h1, .canvas-element p {
    width: 100%;
    height: 100%;
    outline: none;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* Safe area for text */
}

.canvas-element h1 {
    font-size: 48px;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.canvas-element p {
    font-size: 24px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.5;
}

/* Resize Handles - Modern Circular */
.resize-handle {
    width: 14px;
    height: 14px;
    background: #ffffff;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    position: absolute;
    display: none;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    z-index: 10;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.resize-handle:hover {
    transform: scale(1.4);
    background: var(--primary-color);
}

.selected-element .resize-handle {
    display: block;
    animation: popIn 0.2s var(--ease-spring) forwards;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Positioning of Handles */
.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.se { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* =========================================
   5. Floating Controls
   ========================================= */
#zoom-controls {
    position: absolute;
    bottom: 32px;
    right: 32px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-glass);
    z-index: 50;
}

.zoom-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.zoom-btn:hover {
    color: var(--text-main);
    background: rgba(15, 23, 42, 0.05);
}

#zoom-level {
    font-size: 13px;
    font-weight: 600;
    min-width: 48px;
    text-align: center;
    color: var(--text-main);
    font-feature-settings: "tnum"; /* Tabular numbers for stable width */
}

.zoom-divider {
    width: 1px;
    height: 16px;
    background: var(--border-color);
}

/* =========================================
   6. Right Sidebar (Properties Panel)
   ========================================= */
#right-sidebar {
    width: 300px;
    min-width: 300px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.properties-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel-hover);
}

.tab-btn {
    flex: 1;
    padding: 16px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(15, 23, 42, 0.02);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-panel);
}

#properties-content {
    flex: 1;
    overflow-y: auto;
}

.property-group {
    border-bottom: 1px solid var(--border-light);
}

.group-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.group-header:hover {
    background: var(--bg-panel-hover);
}

.group-header h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-weight: 700;
}

.group-header i {
    color: var(--text-light);
    font-size: 12px;
    transition: transform var(--transition-normal);
}

.group-body {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

/* Neumorphic/Clean Form Inputs */
.prop-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    flex: 1;
    transition: all var(--transition-fast);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.prop-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow), inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.prop-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-right: 8px;
    user-select: none;
    text-transform: uppercase;
}

.prop-input-group input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: var(--text-main);
    font-weight: 500;
}

/* Custom Select Dropdowns */
.prop-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: var(--bg-panel);
    color: var(--text-main);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    appearance: none;
    box-shadow: var(--shadow-xs);
    /* Custom precise chevron SVG */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1.5%201.75L6%206.25L10.5%201.75%22%20stroke%3D%22%2364748B%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.prop-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.full-width { width: 100%; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* Alignment Tools */
.align-tools {
    display: flex;
    gap: 8px;
}

.align-tool-btn {
    flex: 1;
    padding: 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.align-tool-btn:hover {
    background: var(--bg-panel-hover);
    color: var(--text-main);
    border-color: var(--text-light);
}

/* Text Align Segmented Control */
.text-align-group {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-panel);
    box-shadow: var(--shadow-xs);
}

.align-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.align-btn:last-child {
    border-right: none;
}

.align-btn.active, .align-btn:hover {
    background: var(--bg-panel-hover);
    color: var(--primary-color);
}
.align-btn.active {
    background: var(--primary-light);
    box-shadow: inset 0 2px 4px rgba(37, 99, 235, 0.05);
}

/* Color Picker UI */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-preview {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.color-preview:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.1);
}

.color-hex-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    outline: none;
    background: var(--bg-panel);
    color: var(--text-main);
    transition: all var(--transition-fast);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.color-hex-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow), inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.opacity-input, .stroke-width-input {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    width: 52px;
    text-align: center;
    background: var(--bg-panel-hover);
    padding: 8px 6px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mt-10 { margin-top: 12px; }
```