/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #1a1a2e;
    color: white;
    overflow: hidden;
    height: 100vh;
}

/* App Container */
.app-container {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
}

.bg-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
}

.bg-gradient-1 {
    background: radial-gradient(circle at 20% 80%, #667eea 0%, transparent 50%);
}

.bg-gradient-2 {
    background: radial-gradient(circle at 80% 20%, #764ba2 0%, transparent 50%);
}

.bg-gradient-3 {
    background: radial-gradient(circle at 40% 40%, #f093fb 0%, transparent 50%);
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon {
    font-size: 1.5rem;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    min-height: 0;
}

/* Panels */
.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.panel-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.editor-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.preview-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.panel-stats {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Editor */
#htmlEditor {
    flex: 1;
    width: 100%;
    padding: 1.5rem;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

#htmlEditor::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Preview */
.preview-container {
    flex: 1;
    padding: 1rem;
    position: relative;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    background: white;
    border-radius: 0.75rem;
    color: #6b7280;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
}

#previewFrame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Toolbar */
.toolbar {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 10px 25px rgba(118, 75, 162, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 10px 25px rgba(250, 112, 154, 0.4);
}

.btn-icon {
    font-size: 1.25rem;
}

/* Status Text */
.status-text {
    margin-left: auto;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .panel {
        min-height: 300px;
    }
    
    .header {
        padding: 1rem;
    }
    
    .toolbar {
        padding: 1rem;
    }
    
    .header-stats {
        gap: 0.5rem;
    }
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .toolbar {
        justify-content: center;
    }
    
    .status-text {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }
}
