/* ══════════════════════════════════════════════════════════════════════
   GLISSEVOLVE - Prompts Configuration Page
   ══════════════════════════════════════════════════════════════════════ */

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

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #FFFFFF;
    --success: #10B981;
    --error: #EF4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px 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);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ══════════════════════════════════════════════════════════════════════ */

.app {
    max-width: 900px;
    margin: 0 auto;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════════ */

.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.header .tagline {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 400;
}

.btn-back {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    transition: all 0.2s;
}

.btn-back:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--gray-50);
}

/* ══════════════════════════════════════════════════════════════════════
   MAIN
   ══════════════════════════════════════════════════════════════════════ */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════
   SELECTOR PANEL
   ══════════════════════════════════════════════════════════════════════ */

.selector-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.selector-panel label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.selector-panel select {
    flex: 1;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--gray-700);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.selector-panel select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ══════════════════════════════════════════════════════════════════════
   EDITOR PANEL
   ══════════════════════════════════════════════════════════════════════ */

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

#promptEditor {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    resize: none;
    background: var(--gray-50);
    color: var(--gray-800);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#promptEditor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--white);
}

#promptEditor::placeholder {
    color: var(--gray-400);
}

/* ══════════════════════════════════════════════════════════════════════
   ACTIONS PANEL
   ══════════════════════════════════════════════════════════════════════ */

.actions-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.actions-left,
.actions-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-message {
    font-size: 0.875rem;
    font-weight: 500;
}

.status-message.success {
    color: var(--success);
}

.status-message.error {
    color: var(--error);
}

.status-message.loading {
    color: var(--gray-500);
}

/* ══════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════ */

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .header h1 {
        font-size: 1.125rem;
    }

    .main {
        padding: 16px;
    }

    .selector-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .selector-panel select {
        max-width: none;
    }

    .actions-panel {
        flex-direction: column;
        gap: 12px;
    }

    .actions-left,
    .actions-right {
        width: 100%;
        justify-content: center;
    }
}
