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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #1e1e1e;
    transition: background-color 0.3s ease;
    margin: 0;
    padding: 0;
}

body.light-mode {
    background: #f5f5f5;
}

body.dark-mode {
    background: #1e1e1e;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(30, 30, 30, 0.98);
    border-bottom: 1px solid #3e3e3e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.light-mode .header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e5e7eb;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

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

/* ACE Editor Container */
#editor {
    position: absolute;
    top: 48px;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: calc(100vh - 48px);
    font-size: 15px;
}

/* ACE Editor customizations */
.ace_editor {
    font-family: 'Courier New', Consolas, Monaco, monospace !important;
}

.ace_gutter {
    background: #2d2d2d !important;
    color: #858585 !important;
}

body.light-mode .ace_gutter {
    background: #f0f0f0 !important;
    color: #6b7280 !important;
}


.format-indicator {
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Theme Toggle Switch - Smaller */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 26px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e5e7eb;
    border-radius: 50px;
    transition: 0.3s;
    overflow: hidden;
}

body.dark-mode .slider {
    background: #374151;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #4c63d2;
    border-radius: 50%;
    transition: 0.3s;
    z-index: 2;
}

.theme-switch input:checked + .slider:before {
    transform: translateX(30px);
}

.icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    z-index: 1;
    transition: 0.3s;
}

.sun-icon {
    left: 7px;
    opacity: 1;
}

.moon-icon {
    right: 7px;
    opacity: 0.4;
}

.theme-switch input:checked ~ .slider .sun-icon {
    opacity: 0.4;
}

.theme-switch input:checked ~ .slider .moon-icon {
    opacity: 1;
}


.btn {
    padding: 5px 12px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: transparent;
    color: #6b7280;
}

body.dark-mode .btn-secondary {
    color: #9ca3af;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Line Counter */
.line-counter {
    position: fixed;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

body.dark-mode .line-counter {
    background: rgba(30, 30, 30, 0.95);
    color: #9ca3af;
}

/* Error Message */
.error-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.error-message:not(:empty) {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 968px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 12px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .toolbar {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    #editor {
        top: auto;
        height: auto;
    }
    
    .theme-switch {
        width: 56px;
        height: 26px;
    }
    
    .slider:before {
        height: 20px;
        width: 20px;
    }
    
    .theme-switch input:checked + .slider:before {
        transform: translateX(30px);
    }
    
    .icon {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px;
        gap: 10px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .toolbar {
        width: 100%;
        justify-content: center;
    }
    
    #editor {
        font-size: 14px;
    }
    
    .line-counter {
        bottom: 8px;
        left: 8px;
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .error-message {
        bottom: 40px;
        left: 8px;
        right: 8px;
        transform: none;
    }
}

