/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root variables for easy customization */
:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --header-bg: #fff;
    --footer-bg: #2c3e50;
    --footer-text: #ecf0f1;
    --max-width: 1200px;
    --spacing: 2rem;
}

/* Base styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fafaf7;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Main content */
main {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#presentation-shell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Scale container - uses JavaScript to scale to fit viewport */
.presentation-scale-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    transform-origin: center center;
}

.canva-placeholder {
    width: 100%;
    height: 100%;
}

/* Remove Canva's default margins and styling */
.canva-placeholder > div {
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .presentation-wrapper {
        border-radius: 8px;
    }
}

/* Glassmorphism Effect */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    z-index: 100;
}

/* Drawing Canvas */
#drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Default to off */
    z-index: 50;
    cursor: crosshair;
}

#drawing-canvas.active {
    pointer-events: all;
}

/* Floating Timer */
#timer-container {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    z-index: 3000;
    border-radius: 30px;
}

#timer-display {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary-color);
}

.timer-controls {
    display: flex;
    gap: 4px;
}

.timer-controls .icon-button {
    width: 28px;
    height: 28px;
}

.timer-controls .icon-button svg {
    width: 16px;
    height: 16px;
}

/* Material Symbols (icon font) */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 20px;
    line-height: 1;
    display: inline-block;
}

/* Drawing Toolbar — fixed to viewport (outside transformed scale box) */
#drawing-toolbar {
    position: fixed;
    bottom: 20px;
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2800;
    background: rgba(255, 255, 255, 0.45);
    border-color: rgba(255, 255, 255, 0.22);
}

#drawing-toolbar:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
}

/* Buttons and Icons */
.icon-button, .tool-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #444;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-button:hover, .tool-button:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.tool-button.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Color Palette */
.color-palette {
    display: flex;
    gap: 8px;
    padding: 0 10px;
    border-left: 1px solid rgba(0,0,0,0.1);
    border-right: 1px solid rgba(0,0,0,0.1);
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

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

.color-swatch.active {
    border-color: #2c3e50;
    transform: scale(1.2);
}

/* Brush Slider */
.brush-settings input {
    width: 80px;
    cursor: pointer;
}

/* Responsive design */
@media (max-width: 768px) {
    #timer-container {
        top: 10px;
        left: 10px;
        right: auto;
        padding: 8px 12px;
    }
    
    #timer-display {
        font-size: 1.1rem;
    }

    #drawing-toolbar {
        bottom: 12px;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        padding: 8px 12px;
        gap: 8px;
    }

    .brush-settings {
        display: none;
    }
}

/* --- SPLIT-SCREEN AUTH REDESIGN --- */
#auth-message {
    margin-top: 15px;
    font-size: 0.85rem;
    text-align: center;
}
#auth-message.error { color: #e11d48; }
#auth-message.success { color: #10b981; }
#auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: #fff;
    overflow-y: auto;
}

.auth-split-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* LEFT SIDE */
.auth-left {
    flex: 1;
    background: white;
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Support logo at top */
    min-width: 450px;
}

.auth-logo-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 2rem;
}

.auth-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.auth-form-box {
    max-width: 400px;
    margin: auto auto; /* Vertically center the form box in remaining space */
    width: 100%;
}

.auth-heading {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.auth-sub-heading {
    font-size: 1rem;
    color: #666;
    margin-bottom: 40px;
}

.form-field {
    margin-bottom: 24px;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.form-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-field input:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.05);
}

/* Password Visibility Toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.password-toggle:hover {
    color: #111;
    background: rgba(0,0,0,0.03);
}

.password-toggle svg.hidden {
    display: none;
}

.btn-black {
    width: 100%;
    padding: 14px;
    background: #111;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.btn-black:hover {
    background: #222;
    transform: translateY(-1px);
}

.btn-google {
    width: 100%;
    padding: 12px;
    background: white;
    color: #444;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.signup-text {
    text-align: center;
    margin-top: 30px;
    font-size: 0.9rem;
    color: #666;
}

.signup-text a {
    color: #111;
    font-weight: 600;
    text-decoration: none;
}

/* RIGHT SIDE */
.auth-right {
    flex: 1.2;
    position: relative;
    background: url('sales-kit-preview.png') center/cover no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 80px;
}

.auth-right-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
    z-index: 1;
}

.auth-right-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 600px;
}

.project-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.project-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -2px;
    line-height: 1;
}

.project-desc {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .auth-right {
        display: none;
    }
    .auth-left {
        padding: 60px 24px;
        min-width: 100%;
        align-items: center;
        text-align: center;
    }
    .auth-logo-row {
        justify-content: center;
        margin-bottom: 3rem;
    }
    .auth-form-box {
        margin: 0;
        width: 100%;
    }
    .auth-heading {
        font-size: 2.2rem;
        margin-bottom: 12px;
    }
    .auth-sub-heading {
        margin-bottom: 3rem;
    }
    .form-field {
        text-align: left;
    }
    .signup-text {
        margin-top: 4rem;
        margin-bottom: 20px;
    }
}

/* Global Hidden Helper */
.hidden {
    display: none !important;
}

/* --- USER CONTROLS (Top Left - FIXED to Screen) --- */
#user-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3000;
}

#user-controls:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#user-email {
    display: none;
}

#btn-logout {
    background: #f8d7da;
    border: none;
    cursor: pointer;
    color: #721c24;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#btn-logout:hover {
    background: #dc3545;
    color: white;
}
