/* ========================================
   ROOT VARIABLES & RESET
   ======================================== */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d29;
    --bg-tertiary: #22253a;
    --bg-editor: #16192a;
    --bg-hover: #2a2f45;
    
    --text-primary: #e4e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --border-color: #2d3348;
    --border-accent: #4a5568;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    --header-height: 65px;
    --panel-header-height: 45px;
    --status-bar-height: 32px;
    
    --font-mono: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    
    --transition-speed: 0.3s;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Light Theme */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-editor: #ffffff;
    --bg-hover: #e2e8f0;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-accent: #cbd5e1;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

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

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0a0d14 100%);
    color: var(--text-primary);
    overflow: hidden;
    transition: all var(--transition-speed);
}

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    backdrop-filter: blur(10px);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

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

.header-left i {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); }
    50% { filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.4)); }
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
}

.desktop-text {
    display: inline;
}

@media (max-width: 768px) {
    .desktop-text {
        display: none;
    }
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
}

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

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

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-icon {
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon-small {
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon-small:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* ========================================
   MAIN CONTENT LAYOUT
   ======================================== */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 14px;
    padding: 14px;
    background: transparent;
}

.editor-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 14px;
    overflow: auto;
}

.preview-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 14px;
    overflow: hidden;
}

/* Horizontal Layout */
.main-content.horizontal {
    flex-direction: column;
}

.main-content.horizontal .editor-section {
    flex-direction: row;
}

.main-content.horizontal .preview-section {
    flex: 1;
}

/* ========================================
   EDITOR PANEL
   ======================================== */
.editor-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), 0 0 0 1px var(--border-color);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 200px;
    overflow: hidden;
    transition: all var(--transition-speed);
    position: relative;
}

.editor-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-color), 
        var(--secondary-color), 
        transparent
    );
    opacity: 0.5;
}

.panel-header {
    height: var(--panel-header-height);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.panel-title i {
    font-size: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.char-count {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ========================================
   CODE EDITOR
   ======================================== */
.editor-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.code-editor {
    width: 100%;
    height: 100%;
    padding: 16px 16px 16px 62px;
    background-color: var(--bg-editor);
    color: var(--text-primary);
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 14.5px;
    line-height: 1.7;
    resize: none;
    tab-size: 4;
    overflow: auto;
    letter-spacing: 0.2px;
}

.code-editor::placeholder {
    color: var(--text-muted);
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 52px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(0, 0, 0, 0.1) 100%);
    color: var(--text-muted);
    padding: 16px 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    text-align: right;
    user-select: none;
    overflow: hidden;
    border-right: 2px solid var(--border-color);
}

/* ========================================
   STATUS BAR
   ======================================== */
.status-bar {
    height: var(--status-bar-height);
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
}

.status-success {
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-error {
    color: var(--danger-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-warning {
    color: var(--warning-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========================================
   PREVIEW PANEL
   ======================================== */
.preview-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), 0 0 0 1px var(--border-color);
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.preview-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--success-color), 
        transparent
    );
    opacity: 0.6;
}

.preview-wrapper {
    flex: 1;
    background-color: white;
    overflow: hidden;
}

#preview {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

/* ========================================
   CONSOLE PANEL
   ======================================== */
.console-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), 0 0 0 1px var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: 250px;
    min-height: 150px;
    transition: max-height var(--transition-speed);
    overflow: hidden;
    position: relative;
}

.console-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--info-color), 
        transparent
    );
    opacity: 0.6;
}

.console-panel.collapsed {
    max-height: var(--panel-header-height);
}

.console-header {
    height: var(--panel-header-height);
    background-color: var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid var(--border-color);
}

.console-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.console-message {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-left: 3px solid;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(0, 0, 0, 0.1) 100%);
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

.console-message:hover {
    background: var(--bg-hover);
    transform: translateX(2px);
}

.console-message i {
    margin-top: 2px;
}

.console-log {
    border-left-color: var(--info-color);
}

.console-error {
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.console-warn {
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.console-info {
    border-left-color: var(--info-color);
    color: var(--info-color);
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 16px 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.slideOut {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification.success {
    background-color: var(--success-color);
    color: white;
}

.notification.error {
    background-color: var(--danger-color);
    color: white;
}

.notification.warning {
    background-color: var(--warning-color);
    color: white;
}

.notification.info {
    background-color: var(--info-color);
    color: white;
}

.notification i {
    font-size: 20px;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-color);
    border: 1px solid var(--border-accent);
    min-width: 450px;
    max-width: 650px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.modal-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-input {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 20px;
    background-color: var(--bg-editor);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-mono);
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.project-item {
    padding: 16px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(0, 0, 0, 0.1) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-item:hover {
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-tertiary) 100%);
    border-color: var(--primary-color);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-name {
    font-weight: 600;
    font-size: 15px;
}

.project-date {
    font-size: 12px;
    color: var(--text-muted);
}

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

.delete-project {
    padding: 6px 10px;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-project:hover {
    background-color: #c0392b;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    border: 2px solid var(--bg-tertiary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1200px) {
    .header h1 {
        font-size: 20px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .editor-section {
        flex-direction: row;
        max-height: 50%;
        min-height: 300px;
    }
    
    .preview-section {
        min-height: 300px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header-left i {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 110px;
        --panel-header-height: 42px;
    }
    
    .header {
        padding: 8px 10px;
        overflow: visible;
        flex-direction: column;
        gap: 8px;
        height: auto;
        min-height: var(--header-height);
    }
    
    .header-left {
        gap: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .header-left i {
        font-size: 20px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .header-right {
        gap: 5px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 11px;
        gap: 4px;
        min-width: auto;
        flex-shrink: 0;
    }
    
    .btn-icon {
        padding: 8px 10px;
    }
    
    .desktop-text {
        display: none;
    }
    
    .main-content {
        padding: 6px;
        gap: 6px;
        height: calc(100vh - var(--header-height));
    }
    
    .editor-section {
        flex-direction: column;
        gap: 6px;
        max-height: none;
    }
    
    .preview-section {
        gap: 6px;
    }
    
    .editor-panel {
        min-height: 160px;
        max-height: 300px;
    }
    
    .panel-header {
        padding: 0 10px;
        height: var(--panel-header-height);
    }
    
    .panel-title {
        font-size: 13px;
    }
    
    .panel-controls {
        gap: 4px;
    }
    
    .char-count {
        display: none;
    }
    
    .code-editor {
        font-size: 12px;
        padding: 10px 10px 10px 42px;
    }
    
    .line-numbers {
        width: 38px;
        padding: 10px 4px;
        font-size: 10px;
    }
    
    .notification {
        min-width: 260px;
        font-size: 12px;
        padding: 12px 16px;
    }
    
    .notification-container {
        right: 8px;
        left: 8px;
        top: calc(var(--header-height) + 10px);
    }
    
    .console-panel {
        min-height: 100px;
        max-height: 180px;
    }
    
    .console-content {
        font-size: 11px;
        padding: 8px;
    }
    
    .modal-content {
        min-width: 95%;
        max-width: 95%;
        margin: 8px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 16px;
        font-size: 13px;
    }
    
    .settings-section {
        padding: 12px;
    }
    
    .settings-section h3 {
        font-size: 15px;
    }
    
    .project-item {
        padding: 12px;
    }
    
    /* Improve touch targets on mobile */
    button {
        min-height: 36px;
        touch-action: manipulation;
    }
    
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    :root {
        --header-height: 130px;
    }
    
    .header {
        padding: 6px 8px;
    }
    
    .header h1 {
        font-size: 14px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .btn-icon {
        padding: 6px 8px;
    }
    
    .btn i {
        font-size: 14px;
    }
    
    .main-content {
        padding: 4px;
        gap: 4px;
    }
    
    .editor-panel {
        min-height: 140px;
    }
    
    .code-editor {
        font-size: 11px;
    }
    
    .modal-content {
        min-width: 98%;
        max-width: 98%;
        margin: 4px;
    }
}
    
    .project-list {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 56px;
        --panel-header-height: 38px;
        --status-bar-height: 28px;
    }
    
    .header {
        padding: 0 8px;
    }
    
    .header-left h1 {
        display: none;
    }
    
    .header-right {
        gap: 4px;
    }
    
    .btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .btn i {
        font-size: 14px;
    }
    
    .btn-icon-small {
        padding: 4px 6px;
    }
    
    .main-content {
        padding: 6px;
        gap: 6px;
    }
    
    .editor-section,
    .preview-section {
        gap: 6px;
    }
    
    .editor-panel {
        min-height: 150px;
    }
    
    .panel-header {
        padding: 0 10px;
    }
    
    .panel-title {
        font-size: 13px;
        gap: 6px;
    }
    
    .panel-title i {
        font-size: 16px;
    }
    
    .code-editor {
        font-size: 12px;
        padding: 10px 10px 10px 42px;
        line-height: 1.5;
    }
    
    .line-numbers {
        width: 38px;
        padding: 10px 4px;
        font-size: 10px;
    }
    
    .status-bar {
        padding: 0 10px;
        font-size: 11px;
    }
    
    .console-panel {
        min-height: 100px;
        max-height: 150px;
    }
    
    .console-message {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .notification {
        min-width: auto;
        font-size: 12px;
        padding: 12px 14px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-input {
        font-size: 13px;
        padding: 10px;
    }
    
    .shortcuts-grid,
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .custom-dialog {
        min-width: 95%;
        max-width: 95%;
    }
    
    .custom-dialog-header {
        padding: 16px;
    }
    
    .custom-dialog-header h3 {
        font-size: 16px;
    }
    
    .custom-dialog-body {
        padding: 16px;
    }
    
    .custom-dialog-footer {
        padding: 12px 16px;
        flex-direction: column;
    }
    
    .custom-dialog-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.hidden {
    display: none !important;
}

.fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1500;
    border-radius: 0 !important;
}

.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

.desktop-buttons {
    gap: 10px;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* Prevent text selection on touch devices when dragging */
@media (hover: none) {
    * {
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .code-editor,
    .code-editor * {
        -webkit-touch-callout: default;
    }
}

/* ========================================
   SYNTAX HIGHLIGHTING HINT
   ======================================== */
.code-editor {
    caret-color: var(--primary-color);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========================================
   ENHANCED HOVER EFFECTS
   ======================================== */
.editor-panel:hover {
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.2);
}

.preview-panel:hover,
.console-panel:hover {
    box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.2);
}

/* ========================================
   FOCUS STATES
   ======================================== */
.code-editor:focus {
    background: var(--bg-editor);
    outline: none;
}

.modal-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ========================================
   BADGE STYLES
   ======================================== */
.char-count {
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding: 4px 8px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.char-count:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

/* ========================================
   STATUS INDICATORS WITH PULSE
   ======================================== */
.status-success i,
.status-error i,
.status-warning i {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========================================
   IMPROVED PREVIEW WRAPPER
   ======================================== */
.preview-wrapper {
    flex: 1;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    overflow: hidden;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ========================================
   GLASSMORPHISM BACKDROP
   ======================================== */
.modal {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.75);
}

/* ========================================
   PROJECT NAME GLOW
   ======================================== */
.project-name {
    font-weight: 700;
    font-size: 15.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   DELETE BUTTON ENHANCEMENT
   ======================================== */
.delete-project {
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.delete-project:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

/* ========================================
   MODAL HEADER GRADIENT
   ======================================== */
.modal-header {
    padding: 22px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 i {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   CONSOLE HEADER STYLING
   ======================================== */
.console-header {
    height: var(--panel-header-height);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-color);
}

/* ========================================
   STATUS BAR ENHANCEMENT
   ======================================== */
.status-bar {
    height: var(--status-bar-height);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-size: 12.5px;
}

/* ========================================
   LIGHT THEME ADJUSTMENTS
   ======================================== */
body.light-theme .preview-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

body.light-theme .header::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

body.light-theme .project-name {
    background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   SETTINGS PANEL STYLES
   ======================================== */
.settings-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.setting-item input[type="range"] {
    width: 100%;
    margin-top: 8px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.template-grid .btn {
    justify-content: center;
    padding: 12px;
    font-size: 13px;
}

/* ========================================
   KEYBOARD SHORTCUTS HELP
   ======================================== */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.shortcut-item kbd {
    background: var(--bg-editor);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    border: 1px solid var(--border-accent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: var(--primary-color);
    font-weight: 600;
}

.shortcut-item span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   CUSTOM DIALOG STYLES
   ======================================== */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

.custom-dialog-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

.custom-dialog {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-color);
    min-width: 400px;
    max-width: 500px;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.custom-dialog-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-dialog-header i {
    font-size: 24px;
    color: var(--primary-color);
}

.custom-dialog-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.custom-dialog-body {
    padding: 24px;
}

.custom-dialog-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.custom-dialog-footer {
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.custom-dialog-footer .btn {
    min-width: 100px;
}

/* ========================================
   RESPONSIVE UPDATES
   ======================================== */
@media (max-width: 600px) {
    .custom-dialog {
        min-width: 90%;
        max-width: 90%;
        margin: 20px;
    }
    
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 38px;
        padding: 10px 14px;
    }
    
    .btn-icon-small {
        min-width: 36px;
        min-height: 36px;
        padding: 8px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover::before {
        display: none;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
    
    /* Improve scrolling */
    .code-editor,
    .console-content,
    .preview-wrapper {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Larger scrollbars for touch */
    ::-webkit-scrollbar {
        width: 14px;
        height: 14px;
    }
    
    ::-webkit-scrollbar-thumb {
        border: 3px solid var(--bg-tertiary);
    }
}

/* ========================================
   LANDSCAPE MOBILE OPTIMIZATION
   ======================================== */
@media (max-width: 900px) and (orientation: landscape) {
    .main-content {
        flex-direction: row;
    }
    
    .editor-section {
        flex-direction: column;
        max-height: none;
        width: 50%;
    }
    
    .preview-section {
        width: 50%;
    }
    
    .console-panel {
        max-height: 150px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .header,
    .notification-container,
    .modal {
        display: none !important;
    }
    
    .main-content {
        display: block;
        height: auto;
    }
    
    .editor-panel,
    .preview-panel {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ========================================
   DEPLOY MODAL STYLES
   ======================================== */
.deploy-options {
    display: grid;
    gap: 15px;
}

.deploy-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.deploy-option:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.deploy-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.deploy-info {
    flex: 1;
}

.deploy-info h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.deploy-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.deploy-option > .fa-arrow-right {
    color: var(--text-secondary);
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.deploy-option:hover > .fa-arrow-right {
    opacity: 1;
}
