/* ==================== GENERAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --dark-bg: #0f172a;
    --darker-bg: #0a0e27;
    --editor-bg: #1a202c;
    --border-color: #2d3748;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --success-color: #48bb78;
    --error-color: #f56565;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1a1a3e 25%, #16213e 50%, #0a0e27 75%, #050a1a 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(102, 126, 234, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ==================== HEADER ==================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    gap: 1rem;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-left {
    flex: 1;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    display: block;
}

.header-right {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

/* ==================== CONTAINER LAYOUT ==================== */
.container {
    display: flex;
    width: 100%;
    height: calc(100vh - 120px);
    padding: 1rem;
    gap: 1rem;
}

.left {
    flex-basis: 50%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.left::-webkit-scrollbar {
    width: 6px;
}

.left::-webkit-scrollbar-track {
    background: transparent;
}

.left::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.left::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.divider {
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--border-color), transparent);
    cursor: col-resize;
}

.right {
    flex-basis: 50%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* ==================== EDITOR SECTIONS ==================== */
.editor-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(26, 32, 44, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: var(--transition);
}

.editor-section:hover {
    border-color: var(--primary-color);
    background: rgba(26, 32, 44, 0.8);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.editor-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    gap: 0.5rem;
}

.editor-label i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(102, 126, 234, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
}

.editor-textarea {
    width: 100%;
    height: 120px;
    background-color: var(--editor-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
    outline: none;
}

.editor-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: rgba(26, 32, 44, 0.9);
}

.editor-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ==================== OUTPUT SECTION ==================== */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.output-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    gap: 0.5rem;
}

.output-label i {
    font-size: 1.2rem;
    color: var(--success-color);
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(72, 187, 120, 0.2);
    color: var(--success-color);
    text-transform: uppercase;
}

.status-badge.error {
    background: rgba(245, 101, 101, 0.2);
    color: var(--error-color);
}

.output-container {
    flex: 1;
    background: rgba(26, 32, 44, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.output-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--editor-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    z-index: 1000;
    max-width: 300px;
    opacity: 0;
    display: none;
}

.toast.show {
    opacity: 1;
    display: block;
}

.toast.success {
    border-left-color: var(--success-color);
}

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

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

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

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 150px);
    }

    .left,
    .right {
        flex-basis: 100%;
        height: auto;
        min-height: 400px;
    }

    .divider {
        width: 100%;
        height: 1px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.4rem;
    }

    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .btn i {
        font-size: 1rem;
    }

    .editor-section {
        padding: 0.8rem;
    }

    .editor-textarea {
        height: 100px;
        font-size: 0.9rem;
    }

    .header-right {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}


