/* ===========================
   BikinPRD - Complete Redesign
   =========================== */

:root {
    --bg: #1a1f2e;
    --bg-secondary: #141824;
    --bg-card: #1e2436;
    --bg-input: #1a1f2e;
    --border: #2a3042;
    --border-focus: #e67e22;
    --text: #e8eaed;
    --text-secondary: #8b95a8;
    --text-muted: #5a6478;
    --accent: #e67e22;
    --accent-hover: #d35400;
    --green: #27ae60;
    --green-light: #2ecc71;
    --teal: #1abc9c;
    --teal-dark: #16a085;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===========================
   Navbar
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(26, 31, 46, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
}

.logo:hover { color: var(--text); }
.logo-icon { font-size: 1.6rem; }
.logo .accent { color: var(--accent); }

.nav-badge {
    padding: 6px 14px;
    background: rgba(230, 126, 34, 0.15);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===========================
   Main Page (Input)
   =========================== */
.main-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
}

.main-container {
    max-width: 720px;
    width: 100%;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 48px;
}

.stepper-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stepper-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}

.stepper-item.active .stepper-dot {
    background: var(--accent);
    box-shadow: 0 0 12px rgba(230, 126, 34, 0.5);
}

.stepper-item.done .stepper-dot {
    background: var(--green);
}

.stepper-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.stepper-item.active .stepper-label {
    color: var(--text);
}

.stepper-item.done .stepper-label {
    color: var(--green);
}

.stepper-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 12px;
}

/* Hero */
.main-hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.main-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero-icon {
    width: 56px;
    height: 56px;
    background: var(--green);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.example-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 16px;
    background: rgba(26, 188, 156, 0.12);
    color: var(--teal);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.example-link:hover {
    background: rgba(26, 188, 156, 0.2);
    color: var(--teal);
}

/* Input Area */
.input-area {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition);
}

.input-area:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.15);
}

.idea-textarea {
    width: 100%;
    padding: 24px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    resize: none;
    min-height: 140px;
}

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

.idea-textarea::placeholder {
    color: var(--text-muted);
}

.input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: var(--text-muted);
}

.language-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
}

.language-select select {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

.language-select select option {
    background: var(--bg-card);
    color: var(--text);
}

.submit-btn {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===========================
   PRD Output Page
   =========================== */
.prd-page {
    min-height: 100vh;
    padding: 80px 24px;
}

.prd-container {
    max-width: 800px;
    margin: 0 auto;
}

.prd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.prd-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.prd-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.back-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* PRD Output Styling */
.prd-output {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    line-height: 1.8;
}

.prd-output h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

.prd-output h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.prd-output h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--accent);
}

.prd-output p {
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.prd-output strong {
    color: var(--text);
    font-weight: 600;
}

.prd-output ul, .prd-output ol {
    padding-left: 24px;
    margin-bottom: 14px;
}

.prd-output li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.prd-output li strong {
    color: var(--text);
}

.prd-output code {
    background: rgba(230, 126, 34, 0.12);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.prd-output pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin: 16px 0;
}

.prd-output pre code {
    background: none;
    color: var(--text);
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

.prd-output table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.prd-output th, .prd-output td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.prd-output th {
    background: var(--bg-secondary);
    color: var(--text);
    font-weight: 600;
}

.prd-output td {
    color: var(--text-secondary);
}

.prd-output blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.prd-output hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===========================
   Toast
   =========================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

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

.toast.success { border-color: var(--green); }
.toast.error { border-color: #e74c3c; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    .main-hero h1 {
        font-size: 2.2rem;
    }

    .hero-title-row {
        flex-direction: column;
        gap: 12px;
    }

    .prd-output {
        padding: 24px;
    }

    .prd-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .prd-actions {
        width: 100%;
    }

    .prd-actions .action-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-hero h1 {
        font-size: 1.8rem;
    }

    .stepper-line {
        width: 30px;
    }

    .input-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .toolbar-left {
        width: 100%;
        justify-content: center;
    }

    .submit-btn {
        width: 100%;
        border-radius: 12px;
        height: 48px;
    }
}