/* ============ RESET & VARIABLES - STUDIO DARK THEME ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    background: #0B0D10;
    color: #E9EEF5;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(64, 224, 255, 0.03) 0%, transparent 45%),
                radial-gradient(circle at 80% 70%, rgba(64, 224, 255, 0.03) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

main {
    flex: 1;
    position: relative;
    z-index: 1;
    width: 100%;
    padding-top: 80px;
}

:root {
    --primary: #40E0FF;
    --primary-dark: #00B8D4;
    --primary-light: rgba(64, 224, 255, 0.15);
    --primary-glow: rgba(64, 224, 255, 0.25);
    --surface-0: #0B0D10;
    --surface-1: #151A21;
    --surface-2: #1E2630;
    --surface-3: #273140;
    --text-primary: #E9EEF5;
    --text-secondary: #C0C8D2;
    --text-tertiary: #9AA5B5;
    --text-muted: #6B7A8F;
    --border: #273140;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 30px rgba(64, 224, 255, 0.25);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --cyan-gradient: linear-gradient(135deg, #40E0FF, #00B8D4);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ===== HEADER STYLES ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(11, 13, 16, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #273140;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--cyan-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0B0D10;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(64, 224, 255, 0.3);
    transition: var(--transition);
}

.logo-link:hover .logo-icon {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 0 30px rgba(64, 224, 255, 0.5);
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #E9EEF5;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.brand-name span { color: #40E0FF; }

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(21, 26, 33, 0.6);
    border-radius: 60px;
    border: 1px solid #273140;
    backdrop-filter: blur(8px);
    padding: 4px 8px;
}

@media (max-width: 1200px) { .nav-desktop { display: none; } }

.nav-link {
    color: #9AA5B5;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: #40E0FF;
    background: rgba(64, 224, 255, 0.1);
    border-color: rgba(64, 224, 255, 0.2);
    transform: translateY(-1px);
}

.nav-link.active {
    background: var(--cyan-gradient);
    color: #0B0D10;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(64, 224, 255, 0.3);
}

.nav-dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #151A21;
    border-radius: 16px;
    padding: 8px;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border: 1px solid #273140;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #9AA5B5;
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: 10px;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: rgba(64, 224, 255, 0.1);
    color: #40E0FF;
    transform: translateX(4px);
}

.dropdown-group-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: #40E0FF;
    padding: 8px 12px 4px;
    border-bottom: 1px solid #273140;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ===== PREMIUM KOFI SUPPORT BUTTON ===== */
.kofi-link {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 44px;
    background: linear-gradient(135deg, #FF6B4A, #FF8E53);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(255, 107, 74, 0.3);
}

.kofi-link:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 25px rgba(255, 107, 74, 0.5);
    background: linear-gradient(135deg, #FF8E53, #FF6B4A);
}

.coffee-cup {
    position: relative;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cup-body {
    position: relative;
    width: 18px;
    height: 16px;
    background: #FFFFFF;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.cup-body::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 11px;
    background: #FFF5E0;
    border-radius: 0 0 6px 6px;
}

.cup-handle {
    position: absolute;
    top: 2px;
    right: -5px;
    width: 6px;
    height: 9px;
    border: 2px solid #FFFFFF;
    border-left: none;
    border-radius: 0 4px 4px 0;
}

.coffee-steam {
    position: absolute;
    top: -8px;
    left: 5px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kofi-link:hover .coffee-steam { opacity: 1; }

.coffee-steam span {
    width: 2px;
    height: 6px;
    background: linear-gradient(to top, rgba(255,255,255,0.8), transparent);
    border-radius: 1px;
    animation: steam 1.2s ease-in-out infinite;
}

.coffee-steam span:nth-child(1) { animation-delay: 0s; }
.coffee-steam span:nth-child(2) { animation-delay: 0.3s; }
.coffee-steam span:nth-child(3) { animation-delay: 0.6s; }

@keyframes steam {
    0% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-4px); opacity: 0.3; }
    100% { transform: translateY(-8px); opacity: 0; }
}

.kofi-tooltip {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    background: #FF6B4A;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 25px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 5px 15px rgba(255, 107, 74, 0.4);
    pointer-events: none;
    z-index: 10;
}

.kofi-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: #FF6B4A;
    border-radius: 2px;
}

.kofi-link:hover .kofi-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -44px;
    transform: translateX(-50%) scale(1);
}

/* Auth Button */
.auth-btn {
    background: transparent;
    border: 1px solid #273140;
    border-radius: 40px;
    padding: 0 16px;
    height: 44px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #9AA5B5;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-btn:hover {
    background: rgba(64, 224, 255, 0.1);
    border-color: rgba(64, 224, 255, 0.2);
    color: #40E0FF;
    transform: translateY(-1px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(21, 26, 33, 0.8);
    border: 1px solid #273140;
    border-radius: 60px;
    padding: 4px 12px 4px 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--cyan-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0B0D10;
}

.share-btn, .mobile-menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1E2630;
    border: 1px solid #273140;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #40E0FF;
    transition: var(--transition);
    cursor: pointer;
}

.share-btn:hover, .mobile-menu-btn:hover {
    background: var(--cyan-gradient);
    color: #0B0D10;
    transform: translateY(-2px);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(64, 224, 255, 0.3);
}

.mobile-menu-btn { display: none; }
@media (max-width: 1200px) { .mobile-menu-btn { display: flex; } }

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: #151A21;
    z-index: 1001;
    transition: right 0.3s ease;
    padding: 80px 20px 20px;
    border-left: 1px solid #273140;
    overflow-y: auto;
}

.mobile-menu.active { right: 0; }

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #9AA5B5;
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
}

.mobile-nav-link.active {
    background: rgba(64, 224, 255, 0.15);
    color: #40E0FF;
}

/* ===== PAGE COMPONENTS ===== */
.page-header { margin-bottom: 40px; }
.page-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(64, 224, 255, 0.1);
    border: 1px solid #273140;
    padding: 5px 12px;
    border-radius: 60px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #40E0FF;
    margin-bottom: 16px;
}
.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #E9EEF5;
}
.gradient-text {
    background: var(--cyan-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-description {
    font-size: 1rem;
    color: #9AA5B5;
    max-width: 700px;
    line-height: 1.6;
}

/* Loading Skeleton */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.skeleton-item {
    height: 60px;
    background: linear-gradient(90deg, #1E2630 25%, #273140 50%, #1E2630 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Source Grid */
.source-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    margin-bottom: 32px;
}
@media (max-width: 900px) { .source-grid { grid-template-columns: 1fr; } }

.source-panel {
    background: #151A21;
    border: 1px solid #273140;
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.source-panel:hover { border-color: #40E0FF; box-shadow: var(--shadow-glow); }

.panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-icon {
    width: 48px;
    height: 48px;
    background: var(--cyan-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #0B0D10;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #273140;
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(64, 224, 255, 0.03);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: #40E0FF;
    background: rgba(64, 224, 255, 0.1);
    transform: scale(1.02);
}

.upload-icon { font-size: 2.5rem; color: #40E0FF; margin-bottom: 16px; }
.file-types { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.file-type-badge {
    background: rgba(64, 224, 255, 0.1);
    border: 1px solid #273140;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.7rem;
    color: #40E0FF;
}
.uploaded-preview {
    margin-top: 20px;
    background: rgba(64, 224, 255, 0.1);
    border: 1px solid #273140;
    border-radius: var(--radius-md);
    padding: 16px;
}
.file-info { display: flex; align-items: center; gap: 16px; }
.clear-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FF5252;
    padding: 8px 16px;
    border-radius: 60px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}
.clear-btn:hover { background: #FF5252; color: #0B0D10; }

/* Font Categories */
.font-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.category-chip {
    background: rgba(64, 224, 255, 0.1);
    border: 1px solid #273140;
    color: #9AA5B5;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}
.category-chip.active, .category-chip:hover {
    background: var(--cyan-gradient);
    color: #0B0D10;
    border-color: transparent;
}

/* Search */
.search-wrapper {
    position: relative;
    margin-bottom: 16px;
}
.search-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7A8F;
}
.search-wrapper input {
    width: 100%;
    background: #1E2630;
    border: 1px solid #273140;
    border-radius: 60px;
    padding: 12px 16px 12px 36px;
    color: #E9EEF5;
}

/* Font List */
.font-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #273140;
    border-radius: var(--radius-md);
    background: #151A21;
}
.font-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #273140;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.font-item.selected {
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.15), rgba(64, 224, 255, 0.05));
    border-left: 3px solid #40E0FF;
}
.font-name { font-weight: 600; color: #E9EEF5; }
.font-meta { display: flex; gap: 8px; font-size: 0.6rem; color: #6B7A8F; }
.font-download-btn {
    background: transparent;
    border: 1px solid #273140;
    color: #6B7A8F;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}
.font-download-btn:hover {
    background: #40E0FF;
    color: #0B0D10;
}
.load-more { text-align: center; padding: 16px; color: #40E0FF; cursor: pointer; font-size: 0.8rem; }
.loading-spinner { display: flex; justify-content: center; padding: 40px; color: #40E0FF; }

/* How-to Guide */
.how-to-guide {
    margin-top: 24px;
    padding: 20px;
    background: #1E2630;
    border-radius: var(--radius-md);
    border: 1px solid #273140;
}
.guide-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 700px) { .guide-steps { grid-template-columns: 1fr; } }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.step-number {
    width: 24px;
    height: 24px;
    background: var(--cyan-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0B0D10;
}
.guide-shortcuts {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #273140;
}
.shortcut-chip {
    background: rgba(64, 224, 255, 0.1);
    border: 1px solid #273140;
    border-radius: 30px;
    padding: 6px 12px;
    font-size: 0.75rem;
}
.shortcut-chip kbd {
    background: #0B0D10;
    color: #40E0FF;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Workspace Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 24px;
    margin-top: 32px;
}
@media (max-width: 1000px) { .workspace-grid { grid-template-columns: 1fr; } }

.canvas-panel, .controls-panel {
    background: #151A21;
    border: 1px solid #273140;
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 1550px;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.canvas-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.canvas-btn {
    background: #1E2630;
    border: 1px solid #273140;
    color: #9AA5B5;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.canvas-btn:hover, .canvas-btn.active {
    background: #40E0FF;
    color: #0B0D10;
    border-color: transparent;
}

/* Canvas */
.canvas-wrapper {
    position: relative;
    background: #151A21;
    border-radius: var(--radius-md);
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #273140;
    transition: all 0.3s ease;
}
.canvas {
    padding: 60px 40px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
}
.wordmark {
    display: flex;
    position: relative;
    user-select: none;
    align-items: baseline;
    justify-content: center;
    flex-wrap: nowrap;
    transition: transform 0.3s ease;
}

.letter-container {
    display: inline-flex;
    align-items: baseline;
    position: relative;
    transition: transform 0.1s;
    vertical-align: baseline;
}

.letter {
    font-size: 120px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.1s;
    color: #E9EEF5;
    font-weight: 700;
    display: inline-block;
    transform-origin: center baseline;
    vertical-align: baseline;
}

/* Fix for stage effects that might affect alignment */
.canvas-wrapper.stage-glass-door .wordmark,
.canvas-wrapper.stage-business-card .wordmark,
.canvas-wrapper.stage-neon .wordmark,
.canvas-wrapper.stage-metallic .wordmark {
    align-items: baseline !important;
}
.letter.selected {
    outline: 3px solid #40E0FF;
    outline-offset: 8px;
    background: rgba(64, 224, 255, 0.1);
    border-radius: 8px;
}
.gap-handle {
    width: 24px;
    height: 48px;
    background: #40E0FF;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0B0D10;
    cursor: ew-resize;
    opacity: 0;
    transition: opacity 0.2s;
    margin: 0 4px;
}
.letter-container:hover .gap-handle { opacity: 1; }

/* ===== 3D PROJECTION STAGES ===== */
.presentation-stage {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #1A2028, #151A21);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(64, 224, 255, 0.2);
    box-shadow: var(--shadow-md);
}

.stage-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: #E9EEF5;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(64, 224, 255, 0.2);
}

.stage-title i { font-size: 1.3rem; color: #40E0FF; }

.stage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stage-card {
    background: rgba(21, 26, 33, 0.8);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(64, 224, 255, 0.15);
    text-align: center;
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.stage-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(64, 224, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.stage-card:hover::before { left: 100%; }
.stage-card:hover {
    transform: translateY(-6px);
    border-color: #40E0FF;
    box-shadow: 0 10px 25px rgba(64, 224, 255, 0.25);
    background: rgba(64, 224, 255, 0.05);
}

.stage-card.active {
    border: 2px solid #40E0FF;
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.12), rgba(64, 224, 255, 0.05));
    box-shadow: 0 0 25px rgba(64, 224, 255, 0.3);
}

.stage-icon {
    font-size: 2.2rem;
    color: #40E0FF;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.stage-card:hover .stage-icon { transform: scale(1.1); }
.stage-name { font-weight: 700; color: #E9EEF5; margin-bottom: 4px; font-size: 0.9rem; }
.stage-desc { font-size: 0.65rem; color: #9AA5B5; line-height: 1.3; }

.stage-preview {
    width: 100%;
    height: 50px;
    margin-top: 12px;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.stage-card:hover .stage-preview { transform: scale(1.02); }

/* Stage Preview Backgrounds */
.stage-preview.glass-door {
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.25), rgba(64, 224, 255, 0.1));
    border: 1px solid rgba(64, 224, 255, 0.3);
    backdrop-filter: blur(4px);
}
.stage-preview.smartphone {
    background: #1E2630;
    border-radius: 16px;
    box-shadow: 0 0 0 2px #273140, 0 0 0 4px #0B0D10;
}
.stage-preview.business-card {
    background: linear-gradient(145deg, #2A3A50, #1E2A3A);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.stage-preview.minimalist {
    background: linear-gradient(135deg, #2A2A35, #1A1A25);
    border-radius: 12px;
}
.stage-preview.material {
    background: #2A2A35;
    background-image: repeating-linear-gradient(45deg, #3A3A45 0px, #3A3A45 1px, transparent 1px, transparent 8px);
    border-radius: 12px;
}
.stage-preview.neon {
    background: #0B0D10;
    box-shadow: 0 0 15px #40E0FF, inset 0 0 10px rgba(64, 224, 255, 0.2);
    animation: previewPulse 2s infinite alternate;
}
@keyframes previewPulse {
    0% { box-shadow: 0 0 10px #40E0FF; }
    100% { box-shadow: 0 0 25px #40E0FF; }
}
.stage-preview.architectural {
    background: repeating-linear-gradient(90deg, #2A3A50 0px, #2A3A50 2px, #1E2A3A 2px, #1E2A3A 8px);
    border-radius: 8px;
}
.stage-preview.leather {
    background: #3A2A1A;
    background-image: radial-gradient(circle at 30% 40%, #4A3A2A 2px, transparent 2px);
    background-size: 15px 15px;
    border-radius: 10px;
}
.stage-preview.metallic {
    background: linear-gradient(145deg, #4A4A55, #2A2A35);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}
.stage-preview.metallic::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: metallicShine 3s infinite;
}
@keyframes metallicShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Export Stage Button */
.export-stage-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #40E0FF, #00B8D4);
    color: #0B0D10;
    border: none;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.export-stage-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.export-stage-btn:hover::before { left: 100%; }
.export-stage-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(64, 224, 255, 0.4);
}

/* 3D Canvas Effects for Active Stage */
.canvas-wrapper.presentation-mode {
    box-shadow: var(--shadow-glow);
    border: 2px solid #40E0FF;
}
.canvas-wrapper.stage-glass-door {
    background: linear-gradient(145deg, rgba(64, 224, 255, 0.15), rgba(64, 224, 255, 0.05));
    backdrop-filter: blur(8px);
    border: 1px solid rgba(64, 224, 255, 0.3);
    border-radius: 20px;
    transform-style: preserve-3d;
    perspective: 1200px;
}
.canvas-wrapper.stage-glass-door .wordmark { transform: rotateY(5deg) rotateX(2deg) translateZ(20px); }
.canvas-wrapper.stage-business-card {
    background: linear-gradient(145deg, #2A2A35, #1A1A25);
    border-radius: 16px;
    perspective: 1500px;
}
.canvas-wrapper.stage-business-card .wordmark { transform: rotateX(3deg) rotateY(8deg) rotateZ(0.5deg) translateZ(15px); }
.canvas-wrapper.stage-neon {
    background: #0B0D10;
    border-radius: 28px;
    box-shadow: 0 0 40px rgba(64, 224, 255, 0.5), 0 0 80px rgba(64, 224, 255, 0.2);
    animation: stageNeonPulse 2s infinite alternate;
}
@keyframes stageNeonPulse {
    0% { box-shadow: 0 0 30px rgba(64, 224, 255, 0.4), 0 0 60px rgba(64, 224, 255, 0.2); }
    100% { box-shadow: 0 0 60px rgba(64, 224, 255, 0.7), 0 0 100px rgba(64, 224, 255, 0.4); }
}
.canvas-wrapper.stage-neon .wordmark { transform: translateZ(30px); }
.canvas-wrapper.stage-neon .letter { filter: drop-shadow(0 0 10px #40E0FF) drop-shadow(0 0 20px #40E0FF); }
.canvas-wrapper.stage-metallic {
    background: linear-gradient(145deg, #3A3A45, #2A2A35);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}
.canvas-wrapper.stage-metallic .wordmark { transform: translateZ(10px); }
.canvas-wrapper.stage-metallic .letter {
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.4));
    background: linear-gradient(135deg, #E9EEF5, #9AA5B5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.canvas-wrapper.stage-smartphone {
    background: #1E2630;
    border-radius: 48px;
    padding: 20px;
    perspective: 1000px;
    box-shadow: 0 0 0 2px #273140, 0 0 0 4px #0B0D10, 0 20px 30px -10px rgba(0,0,0,0.5);
}
.canvas-wrapper.stage-smartphone .wordmark { transform: rotateY(2deg) translateZ(10px); }
.canvas-wrapper.stage-architectural {
    background: repeating-linear-gradient(90deg, #2A3A50 0px, #2A3A50 3px, #1E2A3A 3px, #1E2A3A 30px);
    border-radius: 12px;
    perspective: 1600px;
}
.canvas-wrapper.stage-architectural .wordmark { transform: rotateX(4deg) rotateY(10deg) translateZ(5px); }
.canvas-wrapper.stage-leather {
    background: #3A2A1A;
    background-image: radial-gradient(circle at 30% 40%, #4A3A2A 3px, transparent 3px);
    background-size: 20px 20px;
    border-radius: 20px;
}
.canvas-wrapper.stage-leather .wordmark { transform: translateZ(8px); }
.canvas-wrapper.stage-material {
    background: #2A2A35;
    background-image: repeating-linear-gradient(45deg, #3A3A45 0px, #3A3A45 1px, transparent 1px, transparent 10px);
    border-radius: 20px;
}
.canvas-wrapper.stage-minimalist {
    background: linear-gradient(145deg, #1A1A25, #12121A);
    border-radius: 32px;
    box-shadow: 0 20px 30px -15px rgba(0,0,0,0.5);
}
.canvas-wrapper.stage-minimalist .wordmark { transform: translateZ(5px); }

/* Controls Panel */
.controls-panel { max-height: 800px; overflow-y: auto; }
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #E9EEF5;
}
.section-title i { color: #40E0FF; }
.text-input {
    width: 100%;
    background: #1E2630;
    border: 1px solid #273140;
    border-radius: 60px;
    padding: 14px 20px;
    color: #E9EEF5;
    margin-bottom: 20px;
}

/* Sentiment & AI */
.sentiment-section {
    background: rgba(64, 224, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0;
    border: 1px solid #273140;
}
.sentiment-tag {
    display: inline-block;
    background: var(--cyan-gradient);
    color: #0B0D10;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
}
.identity-kit {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.15), rgba(64, 224, 255, 0.05));
    border-radius: var(--radius-md);
    border: 1px solid #273140;
}
.identity-kit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.identity-kit-label { font-size: 0.75rem; color: #6B7A8F; width: 80px; }
.identity-kit-value { font-weight: 600; color: #E9EEF5; }
.identity-kit-badge {
    background: #40E0FF;
    color: #0B0D10;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.6rem;
}
.pairing-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #1E2630;
    border-radius: var(--radius-md);
    margin-top: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}
.pairing-suggestion:hover {
    background: rgba(64, 224, 255, 0.1);
    transform: translateX(4px);
    border-color: #40E0FF;
}
.apply-btn {
    background: #40E0FF;
    color: #0B0D10;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}
.pairing-suggestion:hover .apply-btn { opacity: 1; }

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    border: 2px solid transparent;
}
.color-swatch:hover {
    transform: translateY(-2px);
    border-color: #E9EEF5;
}
.color-hex {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1E2630;
    color: #40E0FF;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}
.color-swatch:hover .color-hex { opacity: 1; bottom: -25px; }

/* Export Options */
.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
}
.export-btn {
    background: rgba(64, 224, 255, 0.1);
    border: 1px solid #273140;
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.export-btn:hover {
    background: var(--cyan-gradient);
    transform: translateY(-2px);
    color: #0B0D10;
}
.export-btn i { font-size: 1.5rem; margin-bottom: 4px; color: #40E0FF; }

/* Grid Overlays */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}
.fibonacci-overlay {
    background-image: repeating-linear-gradient(45deg, rgba(64, 224, 255, 0.1) 0px, rgba(64, 224, 255, 0.1) 2px, transparent 2px, transparent 8px);
    background-size: 60px 60px;
    animation: fibonacciMove 20s linear infinite;
}
@keyframes fibonacciMove {
    0% { background-position: 0 0; }
    100% { background-position: 60px 60px; }
}

/* API Status */
.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.active-font-indicator {
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.15), rgba(64, 224, 255, 0.05));
    border-radius: 60px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

/* Share Modal */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.share-modal-overlay.active { display: flex; }
.share-modal {
    background: #151A21;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 32px;
    border: 1px solid #273140;
    position: relative;
}
.share-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1E2630;
    border: 1px solid #273140;
    color: #9AA5B5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.share-url-container {
    background: #1E2630;
    border: 1px solid #273140;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.share-url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #E9EEF5;
}
.share-copy-btn {
    background: #40E0FF;
    color: #0B0D10;
    border: none;
    border-radius: 40px;
    padding: 8px 16px;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--cyan-gradient);
    color: #0B0D10;
    padding: 14px 20px;
    border-radius: 60px;
    font-size: 0.85rem;
    z-index: 9999;
    transition: transform 0.3s ease;
    white-space: nowrap;
}
@media (max-width: 768px) { .toast { white-space: normal; max-width: 90%; } }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: linear-gradient(135deg, #FF5252, #FF1744); color: white; }

.badge {
    background: var(--cyan-gradient);
    color: #0B0D10;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 600;
    margin-left: 8px;
}

/* ===== LEGIBILITY SCALE TEST - DYNAMICALLY RESPONSIVE ===== */
.legibility-test {
    background: rgba(30, 38, 48, 0.6);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid rgba(64, 224, 255, 0.15);
    transition: all 0.3s ease;
}

.legibility-test-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.legibility-sample {
    text-align: center;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    padding: 16px 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(64, 224, 255, 0.1);
}

.legibility-sample:hover {
    border-color: rgba(64, 224, 255, 0.3);
    background: rgba(64, 224, 255, 0.05);
    transform: translateY(-2px);
}

.legibility-sample-size {
    font-size: 0.7rem;
    color: #9AA5B5;
    margin-bottom: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.legibility-sample-text {
    background: #151A21;
    border-radius: 12px;
    padding: 16px 8px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    white-space: normal;
    line-height: 1.2;
}

.legibility-sample-text.small { font-size: clamp(12px, 4vw, 16px); }
.legibility-sample-text.medium { font-size: clamp(24px, 8vw, 32px); }
.legibility-sample-text.large { font-size: clamp(48px, 15vw, 96px); }

.legibility-toggle-btn {
    width: 100%;
    background: rgba(64, 224, 255, 0.1);
    border: 1px solid rgba(64, 224, 255, 0.3);
    border-radius: 40px;
    padding: 10px 16px;
    color: #40E0FF;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.legibility-toggle-btn:hover {
    background: #40E0FF;
    color: #0B0D10;
    transform: translateY(-1px);
}

/* Responsive breakpoints for Legibility Test */
@media (max-width: 1024px) {
    .legibility-test-grid { gap: 12px; }
    .legibility-sample { padding: 12px 8px; }
    .legibility-sample-text { min-height: 70px; padding: 12px 6px; }
}

@media (max-width: 900px) {
    .legibility-test-grid { gap: 10px; }
    .legibility-sample-size { font-size: 0.65rem; }
}

@media (max-width: 768px) {
    .legibility-test-grid { grid-template-columns: 1fr; gap: 16px; }
    .legibility-sample {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 12px 16px;
        gap: 16px;
    }
    .legibility-sample-size { width: 80px; margin-bottom: 0; }
    .legibility-sample-text { flex: 1; min-height: 60px; padding: 10px 12px; }
    .legibility-sample-text.small { font-size: clamp(14px, 5vw, 18px); }
    .legibility-sample-text.medium { font-size: clamp(20px, 7vw, 28px); }
    .legibility-sample-text.large { font-size: clamp(32px, 12vw, 56px); }
}

@media (max-width: 480px) {
    .legibility-test { padding: 12px; }
    .legibility-sample {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px;
    }
    .legibility-sample-size { width: 100%; text-align: center; }
    .legibility-sample-text { width: 100%; justify-content: center; }
    .legibility-sample-text.small { font-size: 16px; }
    .legibility-sample-text.medium { font-size: 24px; }
    .legibility-sample-text.large { font-size: 42px; }
    .legibility-toggle-btn { padding: 8px 12px; font-size: 0.75rem; }
}

/* ===== PREMIUM TOGGLE BUTTONS ===== */
.pro-tools-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 120px;
    background: linear-gradient(135deg, #1E2630, #151A21);
    border: 2px solid rgba(64, 224, 255, 0.4);
    border-right: none;
    border-radius: 36px 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4), -4px 0 15px rgba(64, 224, 255, 0.2);
    backdrop-filter: blur(8px);
}

.pro-tools-toggle:hover {
    width: 60px;
    background: linear-gradient(135deg, #40E0FF, #00B8D4);
    border-color: transparent;
    box-shadow: -8px 0 35px rgba(64, 224, 255, 0.5);
}

.pro-tools-toggle .toggle-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.pro-tools-toggle i {
    font-size: 1.6rem;
    color: #40E0FF;
    transition: all 0.3s ease;
}
.pro-tools-toggle span {
    writing-mode: vertical-rl;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #9AA5B5;
    transition: all 0.3s ease;
}
.pro-tools-toggle:hover i,
.pro-tools-toggle:hover span { color: #0B0D10; }
.pro-tools-toggle.open i { transform: rotate(180deg); }

/* History Toggle */
.history-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 120px;
    background: linear-gradient(135deg, #1E2630, #151A21);
    border: 2px solid rgba(64, 224, 255, 0.4);
    border-left: none;
    border-radius: 0 36px 36px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4), 4px 0 15px rgba(64, 224, 255, 0.2);
    backdrop-filter: blur(8px);
}

.history-toggle:hover {
    width: 60px;
    background: linear-gradient(135deg, #40E0FF, #00B8D4);
    border-color: transparent;
    box-shadow: 8px 0 35px rgba(64, 224, 255, 0.5);
}

.history-toggle .toggle-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.history-toggle i {
    font-size: 1.6rem;
    color: #40E0FF;
    transition: all 0.3s ease;
}
.history-toggle span {
    writing-mode: vertical-rl;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #9AA5B5;
    transition: all 0.3s ease;
}
.history-toggle:hover i,
.history-toggle:hover span { color: #0B0D10; }
.history-toggle.open i { transform: rotate(180deg); }

/* ===== PRO TOOLS SIDEBAR ===== */
.pro-tools-sidebar {
    position: fixed;
    right: -480px;
    top: 50%;
    transform: translateY(-50%);
    width: 420px;
    max-height: 85vh;
    background: rgba(15, 20, 25, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(64, 224, 255, 0.25);
    border-right: none;
    border-radius: 32px 0 0 32px;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: -15px 0 50px rgba(0, 0, 0, 0.5), -5px 0 25px rgba(64, 224, 255, 0.2);
    overflow: hidden;
}
.pro-tools-sidebar.open { right: 0; }

.pro-tools-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(64, 224, 255, 0.2);
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.08), transparent);
    flex-shrink: 0;
}
.pro-tools-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #E9EEF5;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pro-tools-title i {
    font-size: 1.6rem;
    color: #40E0FF;
    text-shadow: 0 0 10px rgba(64, 224, 255, 0.5);
}
.pro-tools-subtitle {
    font-size: 0.75rem;
    color: #9AA5B5;
    margin-top: 8px;
    padding-left: 40px;
}

.pro-tools-content {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #40E0FF #1E2630;
}
.pro-tools-content::-webkit-scrollbar { width: 5px; }
.pro-tools-content::-webkit-scrollbar-track { background: #1E2630; border-radius: 10px; }
.pro-tools-content::-webkit-scrollbar-thumb { background: #40E0FF; border-radius: 10px; }

.pro-tools-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.pro-tools-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.pro-tools-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #40E0FF;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Kerning Pair Control */
.kerning-pair-control {
    background: rgba(30, 38, 48, 0.6);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid rgba(64, 224, 255, 0.15);
}
.kerning-pair-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.kerning-pair-icons { display: flex; align-items: center; gap: 8px; }
.kerning-letter {
    font-size: 2rem;
    font-weight: 800;
    color: #40E0FF;
    font-family: monospace;
    background: rgba(64, 224, 255, 0.1);
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}
.kerning-pair-selector {
    background: #1E2630;
    border: 1px solid #273140;
    border-radius: 40px;
    padding: 10px 16px;
    color: #E9EEF5;
    width: 100%;
    cursor: pointer;
    margin-bottom: 16px;
}

/* Transform Controls */
.transform-control {
    background: rgba(30, 38, 48, 0.6);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
}
.transform-label {
    display: flex;
    justify-content: space-between;
    color: #9AA5B5;
    margin-bottom: 10px;
    font-size: 0.8rem;
}
.transform-slider {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: #1E2630;
    -webkit-appearance: none;
    appearance: none;
}
.transform-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #40E0FF;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(64, 224, 255, 0.5);
}
.transform-value {
    color: #40E0FF;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Smart Toggles */
.smart-weight-toggle, .smart-opsz-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 14px;
    background: rgba(64, 224, 255, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(64, 224, 255, 0.15);
}
.smart-weight-toggle input, .smart-opsz-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #40E0FF;
    cursor: pointer;
}
.smart-weight-toggle label, .smart-opsz-toggle label {
    flex: 1;
    font-weight: 600;
    color: #E9EEF5;
    cursor: pointer;
    font-size: 0.85rem;
}
.smart-weight-badge, .smart-opsz-badge {
    background: var(--cyan-gradient);
    color: #0B0D10;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
}

/* APCA Analyzer */
.apca-analyzer {
    background: rgba(30, 38, 48, 0.6);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid rgba(64, 224, 255, 0.15);
}
.apca-bar {
    height: 8px;
    background: #1E2630;
    border-radius: 10px;
    overflow: hidden;
    margin: 12px 0 8px;
}
.apca-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF5252, #FFB74D, #4CAF50);
    border-radius: 10px;
    transition: width 0.3s ease;
}
.apca-value { display: flex; justify-content: space-between; align-items: center; }
.apca-score { font-weight: 700; color: #E9EEF5; font-size: 1.2rem; }
.apca-status {
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
}
.apca-status.pass { background: rgba(76, 175, 80, 0.2); color: #4CAF50; }
.apca-status.fail { background: rgba(255, 82, 82, 0.2); color: #FF5252; }
.apca-status.warn { background: rgba(255, 183, 77, 0.2); color: #FFB74D; }

/* Grid Controls */
.grid-overlay-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.overlay-btn {
    flex: 1;
    background: #1E2630;
    border: 1px solid #273140;
    color: #9AA5B5;
    padding: 10px;
    border-radius: 40px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.overlay-btn.active {
    background: #40E0FF;
    color: #0B0D10;
    border-color: transparent;
}

/* ===== PROJECT HISTORY DRAWER ===== */
.history-drawer {
    position: fixed;
    left: -480px;
    top: 50%;
    transform: translateY(-50%);
    width: 420px;
    max-height: 85vh;
    background: rgba(15, 20, 25, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(64, 224, 255, 0.25);
    border-left: none;
    border-radius: 0 32px 32px 0;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: 15px 0 50px rgba(0, 0, 0, 0.5), 5px 0 25px rgba(64, 224, 255, 0.2);
    overflow: hidden;
}
.history-drawer.open { left: 0; }

.history-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(64, 224, 255, 0.2);
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.08), transparent);
    flex-shrink: 0;
}
.history-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #E9EEF5;
    display: flex;
    align-items: center;
    gap: 12px;
}
.history-title i {
    font-size: 1.6rem;
    color: #40E0FF;
    text-shadow: 0 0 10px rgba(64, 224, 255, 0.5);
}
.history-subtitle {
    font-size: 0.75rem;
    color: #9AA5B5;
    margin-top: 8px;
    padding-left: 40px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #40E0FF #1E2630;
}
.history-list::-webkit-scrollbar { width: 5px; }
.history-list::-webkit-scrollbar-track { background: #1E2630; border-radius: 10px; }
.history-list::-webkit-scrollbar-thumb { background: #40E0FF; border-radius: 10px; }

.history-item {
    background: rgba(30, 38, 48, 0.8);
    border: 1px solid rgba(64, 224, 255, 0.15);
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}
.history-item:hover {
    transform: translateX(6px);
    border-color: rgba(64, 224, 255, 0.5);
    background: rgba(40, 50, 65, 0.9);
    box-shadow: 0 6px 20px rgba(64, 224, 255, 0.15);
}
.history-item.active {
    border-color: #40E0FF;
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.12), rgba(64, 224, 255, 0.05));
}
.history-preview {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #E9EEF5;
    letter-spacing: 0.5px;
    word-break: break-word;
}
.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #6B7A8F;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.history-font {
    background: rgba(64, 224, 255, 0.12);
    padding: 4px 10px;
    border-radius: 30px;
    color: #40E0FF;
    font-size: 0.65rem;
    font-weight: 500;
}
.history-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.history-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9AA5B5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.history-btn:hover {
    background: #40E0FF;
    color: #0B0D10;
    transform: scale(1.08);
}
.history-btn.delete:hover {
    background: #FF5252;
    color: white;
}
.history-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
    background: rgba(15, 20, 25, 0.95);
    flex-shrink: 0;
}
.history-footer-btn {
    flex: 1;
    background: rgba(30, 38, 48, 0.8);
    border: 1px solid rgba(64, 224, 255, 0.2);
    color: #9AA5B5;
    padding: 10px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.history-footer-btn:hover {
    background: var(--cyan-gradient);
    color: #0B0D10;
    transform: translateY(-2px);
}

.empty-history {
    text-align: center;
    padding: 50px 20px;
    color: #6B7A8F;
}
.empty-history i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
    color: #40E0FF;
}
.empty-history p { font-size: 0.85rem; margin-top: 8px; }
.empty-history .small-text { font-size: 0.7rem; margin-top: 12px; opacity: 0.6; }

/* Scrubbable Labels */
.scrubbable-label {
    cursor: ew-resize;
    user-select: none;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.scrubbable-label:hover { background: rgba(64, 224, 255, 0.15); }
.scrubbable-label:active {
    background: rgba(64, 224, 255, 0.3);
    cursor: grabbing;
}
.scrubbable-label i {
    font-size: 0.7rem;
    opacity: 0.6;
    color: #40E0FF;
}
.scrubbable-hint {
    font-size: 0.55rem;
    color: #6B7A8F;
    margin-left: 4px;
    opacity: 0.5;
}
.value-flash {
    animation: valueFlash 0.25s ease;
}
@keyframes valueFlash {
    0% { color: #E9EEF5; }
    50% { color: #40E0FF; text-shadow: 0 0 10px #40E0FF; transform: scale(1.05); }
    100% { color: #E9EEF5; }
}

/* ===== MOBILE RESPONSIVE - FINAL FIXES ===== */
@media (max-width: 768px) {
    .page-title { font-size: 1.8rem; }
    .brand-name { font-size: 1.1rem; }
    .logo-icon { width: 36px; height: 36px; }
    .header-container { padding: 10px 16px; }
    
    /* Mobile Canvas Fixes */
    .letter { font-size: 60px !important; }
    .canvas { padding: 30px 20px !important; overflow-x: auto; }
    .gap-handle { width: 20px !important; height: 36px !important; }
    .gap-handle i { font-size: 10px !important; }
    .gap-value-tooltip { font-size: 10px !important; top: -30px !important; }
    
    /* Sidebar adjustments */
    .pro-tools-sidebar { width: 320px; right: -360px; max-height: 80vh; }
    .history-drawer { width: 320px; left: -360px; max-height: 80vh; }
    .pro-tools-sidebar.open { right: 0; }
    .history-drawer.open { left: 0; }
    
    .pro-tools-toggle, .history-toggle { width: 42px; height: 90px; }
    .pro-tools-toggle span, .history-toggle span { display: none; }
    .pro-tools-toggle i, .history-toggle i { font-size: 1.3rem; }
    
    /* Pro Tools Content */
    .pro-tools-content { padding: 16px; }
    .kerning-letter { width: 45px; height: 45px; font-size: 1.6rem; }
    .pro-tools-title { font-size: 1.2rem; }
    .pro-tools-title i { font-size: 1.3rem; }
    
    /* Smart guides hidden on mobile */
    .smart-guide { display: none !important; }
    
    /* Stage grid */
    .stage-grid { grid-template-columns: repeat(2, 1fr); }
    
    /* Toast */
    .toast { white-space: normal; max-width: 90%; }
    
    /* Identity kit */
    .identity-kit-item { flex-wrap: wrap; }
    .identity-kit-label { width: 100%; margin-bottom: 4px; }
}

@media (max-width: 480px) {
    .brand-name { font-size: 1rem; }
    .logo-icon { width: 32px; height: 32px; }
    .kofi-link, .share-btn, .mobile-menu-btn { width: 40px; height: 40px; }
    
    .stage-grid { grid-template-columns: 1fr; }
    .letter { font-size: 48px !important; }
    .canvas { padding: 20px 12px !important; }
    
    .pro-tools-sidebar { width: 280px; right: -320px; }
    .history-drawer { width: 280px; left: -320px; }
    .pro-tools-header { padding: 20px 16px; }
    .pro-tools-content { padding: 12px; }
    
    .kerning-letter { width: 38px; height: 38px; font-size: 1.3rem; }
    
    .export-options { grid-template-columns: 1fr; }
}

/* Accessibility */
button:focus-visible, .category-chip:focus-visible, .font-item:focus-visible, 
.stage-card:focus-visible, .export-btn:focus-visible {
    outline: 3px solid #40E0FF;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}