/* CSS Variables for Theming */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --bg-dark: #1e293b;
    --bg-light: #f8fafc;
    --bg-panel: #0f172a;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.logo svg {
    display: block;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-image {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.hero-image {
    height: 120px;
    width: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
    object-fit: contain;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    flex: 1;
    padding: 1rem;
    overflow: hidden;
}

/* Editor Panels */
.editor-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid var(--border-color);
}

.panel-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.copy-button:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.editor {
    flex: 1;
    min-height: 0;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
}

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

/* Example Dropdown */
.example-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.25rem;
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 10;
    overflow: hidden;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

/* Options Panel */
.options-panel {
    padding: 0 1rem 1rem;
}

.options-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.options-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
}

.options-content {
    display: none;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.options-content.show {
    display: flex;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-select {
    padding: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.option-checkbox {
    cursor: pointer;
    width: 1rem;
    height: 1rem;
}

/* Footer */
.footer {
    padding: 1rem 2rem;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
}

.stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(calc(100% + 2rem));
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
}

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

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

.toast-content {
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto 1fr;
    }

    .controls {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        padding: 0.5rem;
    }

    .example-dropdown {
        width: 100%;
    }

    .options-content {
        flex-wrap: wrap;
    }

    .title {
        font-size: 1.25rem;
    }

    .stats {
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .title {
        font-size: 1rem;
    }

    .header-image {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .hero-image {
        height: 90px;
    }

    .main-content {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .footer {
        padding: 0.75rem 1rem;
    }

    .stats {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
}
