/* ═══════════════════════════════════════════════════════════
   PROMPT REFINER - STYLES
   ═══════════════════════════════════════════════════════════ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #ffffff;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* ─────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────── */
header {
    text-align: center;
    padding: 30px 0;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #00d9ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: #888;
    font-size: 1rem;
}

/* ─────────────────────────────────────────────
   SCREENS
   ───────────────────────────────────────────── */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ─────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────── */
.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.card h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.card .subtitle {
    color: #888;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   INPUTS
   ───────────────────────────────────────────── */
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: #00d9ff;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

textarea::placeholder {
    color: #666;
}

/* ─────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 16px;
    margin-top: 16px;
    background: linear-gradient(90deg, #00d9ff, #00ff88);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

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

.btn-secondary {
    width: 100%;
    padding: 16px;
    margin-top: 12px;
    background: transparent;
    border: 2px solid #00d9ff;
    border-radius: 12px;
    color: #00d9ff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(0, 217, 255, 0.1);
}

.button-group {
    margin-top: 20px;
}

/* ─────────────────────────────────────────────
   CHAT
   ───────────────────────────────────────────── */
.chat-card {
    display: flex;
    flex-direction: column;
    height: 70vh;
    max-height: 600px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    margin-bottom: 16px;
}

.message {
    margin-bottom: 16px;
    animation: messageIn 0.3s ease;
}

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

.message.ai {
    background: rgba(0, 217, 255, 0.1);
    border-left: 3px solid #00d9ff;
    padding: 12px 16px;
    border-radius: 0 12px 12px 0;
}

.message.user {
    background: rgba(0, 255, 136, 0.1);
    border-left: 3px solid #00ff88;
    padding: 12px 16px;
    border-radius: 0 12px 12px 0;
}

.message-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area textarea {
    flex: 1;
}

.btn-send {
    padding: 12px 24px;
    background: #00ff88;
    border: none;
    border-radius: 12px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send:hover {
    background: #00cc6a;
}

.btn-generate {
    width: 100%;
    padding: 20px;
    margin-top: 16px;
    background: linear-gradient(90deg, #ff6b6b, #ffa502);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(255, 107, 107, 0); }
}

.btn-generate:hover {
    transform: scale(1.02);
}

/* ─────────────────────────────────────────────
   FINAL PROMPT
   ───────────────────────────────────────────── */
.final-prompt {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* ─────────────────────────────────────────────
   LOADING
   ───────────────────────────────────────────── */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    margin-top: 16px;
    color: #888;
}

/* ─────────────────────────────────────────────
   UTILITIES
   ───────────────────────────────────────────── */
.hidden {
    display: none !important;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
