:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #ffd700;
    --primary-hover: #e6c200;
    --accent: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(255, 215, 0, 0.5);
    --glass: blur(12px);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Glow Effect */
.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(29, 78, 216, 0.15), rgba(76, 29, 149, 0.15), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

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

.step-card, .generator-card {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Navigation */
.top-nav {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-links {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.ai-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    color: var(--primary);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Hero */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    color: var(--primary);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Step Cards */
.step-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.step-card.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.8);
}

.step-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-number {
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    color: #1e293b;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    flex-shrink: 0;
}

.step-title {
    font-size: 1.75rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--text-muted);
}

/* Input Fields */
.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: var(--text-main);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    resize: none; /* For textarea */
}

textarea.input-field {
    min-height: 120px;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
    background: rgba(0, 0, 0, 0.4);
}

.icon-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

textarea ~ .icon-btn {
    top: 20px;
}

.icon-btn:hover {
    color: #ef4444; /* Red for delete */
}

/* Tooltip */
.tooltip {
    position: relative;
}
.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #334155;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 5px;
    opacity: 1;
}

/* Buttons */
.cta-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #daa520 100%);
    color: #1e293b;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
    filter: brightness(1.1);
}

.cta-button:active {
    transform: translateY(0);
}

/* History Section */
.history-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.history-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
}

/* Output Display */
.prompt-display {
    margin-top: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    border: 1px solid var(--border-glow);
    overflow: hidden;
}

.hidden {
    display: none;
}

.prompt-header {
    background: rgba(255, 215, 0, 0.1);
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.prompt-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.prompt-actions {
    display: flex;
    gap: 0.8rem;
}

.action-button {
    background: var(--primary);
    color: #1e293b;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.action-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.action-button:hover {
    filter: brightness(1.1);
}

.prompt-content {
    padding: 0;
}

.prompt-textarea {
    width: 100%;
    min-height: 150px;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 1.2rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

.prompt-textarea:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.2);
}

/* Generators Grid */
.generators-section {
    margin-top: 4rem;
    padding-bottom: 3rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.generators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
}

.generator-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.generator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.3);
}

.generator-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.generator-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.generator-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

.prompt-area {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid var(--border);
    position: relative;
}

.prompt-actions-bar {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.mini-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.mini-btn:hover {
    background: var(--primary);
    color: #1e293b;
}

.mini-textarea {
    width: 100%;
    height: 100px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 10px;
    padding-top: 35px; /* space for buttons */
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.mini-textarea:focus {
    outline: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .step-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        align-items: center;
    }
    
    .step-card {
        padding: 1.5rem;
    }
    
    .generators-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        flex-direction: column;
    }
}
