
:root {
    --primary-purple: #8D5AF3;
    --purple-light: #b56cf6;
    --dark-bg: #212529;
    --darker-bg: #09090B;
    --card-bg: #27272A;
    --card-border: #3F3F46;
    --text-primary: #FFFFFF;
    --text-secondary: #949494;
    --text-muted: #52525B;
    --text-footer: #ccc;
    --button-dark: #212529;
    --success-green: #22C55E;
    --warning-orange: #F59E0B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to top, var(--darker-bg), var(--dark-bg));
}

/* Header */
.header {
    padding: 1.5rem 3rem;
    background-color: transparent;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
}

.logo img {
    height: 3rem;
}

.logo-placeholder {
    width: 3rem;
    height: 3rem;
    background: var(--primary-purple);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.new-prompt-btn {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.new-prompt-btn:hover {
    background: var(--button-dark);
    color: var(--primary-purple);
    transform: translateY(-1px);
}

.login-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.login-link:hover {
    opacity: 1;
    color: var(--primary-purple);
}

/* Main Content */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
}

/* Response Page Layout */
.main-container.response-layout {
    max-width: 1200px;
    align-items: stretch;
    justify-content: flex-start;
    padding-top: 2rem;
}

.greeting-section {
    text-align: left;
    margin-bottom: 1rem;
    width: 100%;
}

.greeting-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(to top, var(--primary-purple), var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.greeting-subtitle {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 400;
    opacity: 0.95;
}

/* Input Card */
.input-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

.prompt-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    outline: none;
    min-height: 3rem;
    margin-bottom: 1rem;
    font-family: inherit;
    line-height: 1.5;
}

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

.prompt-textarea:hover::placeholder {
    opacity: 0.9;
}

.prompt-textarea:focus {
    min-height: 5rem;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.left-action {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.right-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.type-select {
    background: var(--card-bg);
    color: var(--text-primary);
    border: none;
    padding: 0.5rem 1rem 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
}

.generate-btn {
    background: var(--primary-purple);
    color: white;
    border: none;
    padding: 0.5rem 1rem 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.generate-btn:hover {
    background: var(--purple-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

/* Request Summary */
.request-summary {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

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

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

.request-type {
    background: var(--primary-purple);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.original-request {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    font-style: italic;
}

/* Generated Response */
.response-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

.response-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 0;
}

.response-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.response-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.status-badge {
    background: var(--success-green);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.response-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-bottom: 1.5rem;
}

.response-content {
    padding: 1.5rem;
    position: relative;
}

.generated-prompt {
    background: var(--darker-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    position: relative;
    overflow: auto;
    max-height: 500px;
}

.copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.copy-button:hover {
    background: var(--primary-purple);
    color: white;
    transform: translateY(-1px);
}

/* Action Buttons */
.action-buttons {
    padding: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--purple-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
    color: white;
}

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

.btn-secondary:hover {
    background: var(--button-dark);
    color: var(--primary-purple);
    transform: translateY(-1px);
}

/* Bottom Text */
.bottom-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* Footer */
.footer {
    padding: 2rem 3rem;
    margin-top: auto;
}

.footer.response-footer {
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    color: var(--text-footer);
    font-size: 0.8125rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: var(--text-footer);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-purple);
}

/* Animation for content loading */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* Hidden elements for page switching */
.hidden {
    display: none !important;
}

.response-page {
    display: none;
}

.response-page.active {
    display: block;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .generate-btn {
    background: var(--text-muted);
    cursor: not-allowed;
}

.loading .generate-btn::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1.25rem 1.5rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .greeting-title {
        font-size: 2rem;
    }
    
    .greeting-subtitle {
        font-size: 1.125rem;
    }
    
    .input-card {
        padding: 1.25rem;
    }
    
    .card-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .right-actions {
        width: 100%;
        gap: 0.5rem;
    }
    
    .type-select,
    .generate-btn {
        width: 100%;
    }
    
    .request-header,
    .response-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .response-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .footer {
        padding: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .copy-button {
        position: static;
        margin-bottom: 1rem;
        align-self: flex-start;
    }
    
    .generated-prompt {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .greeting-title {
        font-size: 2.5rem;
    }
    
    .greeting-subtitle {
        font-size: 1rem;
    }
    
    .main-container {
        padding: 1rem;
    }
    
    .main-container.response-layout {
        padding: 1rem;
    }
    
    .request-summary,
    .response-content {
        padding: 1rem;
    }
}