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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 100vw;
    padding: 20px;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #333;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(17, 153, 142, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    font-weight: 700;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.3);
}

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

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3);
}

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

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-orange {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b35 100%);
    color: white;
    font-weight: 700;
}

.btn-orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 140, 0, 0.3);
}

.icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    position: relative;
}

.dropdown-toggle:after {
    content: '▼';
    margin-left: 8px;
    font-size: 10px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background: #3a3a3a;
}

.dropdown-item .icon {
    margin-right: 8px;
    font-size: 14px;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
}

.code-section {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    background: #222;
    border-bottom: 1px solid #333;
}

.tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    color: #fff;
    background: #2a2a2a;
}

.tab.active {
    color: #fff;
    background: #2a2a2a;
    border-bottom-color: #667eea;
}

.code-editor {
    flex: 1;
    position: relative;
}

.code-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.code-input.active {
    opacity: 1;
    visibility: visible;
}

.code-input::placeholder {
    color: #666;
}

.preview-section {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    background: #222;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
}

.preview-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

#previewFrame {
    flex: 1;
    border: none;
    background: white;
    width: 100%;
    height: 100%;
}

.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background: #10b981;
    color: white;
}

.message.error {
    background: #ef4444;
    color: white;
}

@media (max-width: 1200px) {
    .editor-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    .code-section {
        height: 400px;
    }
    
    .preview-section {
        height: 400px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .icon {
        margin-right: 6px;
        font-size: 14px;
    }
    
    /* Responsive dropdown styles */
    .dropdown-menu {
        min-width: 120px;
    }
    
    .dropdown-item {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .dropdown-item .icon {
        margin-right: 6px;
        font-size: 12px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .editor-container {
        height: calc(100vh - 280px);
    }
    
    .code-section {
        height: 350px;
    }
    
    .preview-section {
        height: 350px;
    }
}

/* Scrollbar styling */
.code-input::-webkit-scrollbar {
    width: 8px;
}

.code-input::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.code-input::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.code-input::-webkit-scrollbar-thumb:hover {
    background: #777;
}
