/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f97316;
    --primary-dark: #ea580c;
    --secondary-color: #fbbf24;
    --accent-color: #34d399;
    --text-primary: #fafaf9;
    --text-secondary: #d6d3d1;
    --text-light: #a8a29e;
    --background-primary: #1c1917;
    --background-secondary: #292524;
    --background-tertiary: #44403c;
    --border-light: #44403c;
    --border-medium: #57534e;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-primary);
}

.hidden {
    display: none !important;
}

/* Header Styles */
.header {
    background: var(--background-primary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(28, 25, 23, 0.95);
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.nav-brand .tagline {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Model Status Banner */
.model-status-banner {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    position: relative;
}

.close-banner {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-banner:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 80px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--background-secondary) 0%, var(--background-tertiary) 50%, var(--background-primary) 100%);
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(249, 115, 22, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(251, 191, 36, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.storytelling-intro {
    margin-bottom: 3rem;
}

.krik-question {
    font-size: 4rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease-out;
    text-shadow: 0 0 30px rgba(249, 115, 22, 0.3);
}

.krak-response {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 2rem;
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg), 0 0 0 0 rgba(249, 115, 22, 0.4);
    position: relative;
    overflow: hidden;
}

.krak-response:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), 0 0 20px 0 rgba(249, 115, 22, 0.6);
}

.krak-response:active {
    transform: translateY(0);
}

.krak-response::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.krak-response:hover::before {
    left: 100%;
}

.engagement-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* Generation Form */
.generation-form {
    background: var(--background-primary);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease-out 0.5s both;
    text-align: left;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.prompt-input-container {
    position: relative;
}

.prompt-input-container textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
    resize: vertical;
    padding-right: 3rem;
    background: var(--background-secondary);
    color: var(--text-primary);
}

.prompt-input-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.mic-button {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mic-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.mic-button.recording {
    background: #ef4444;
    animation: pulse 1s infinite;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    background: var(--background-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
}

select option {
    background: var(--background-secondary);
    color: var(--text-primary);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.generate-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-md), 0 0 0 0 rgba(249, 115, 22, 0.4);
}

.generate-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), 0 0 15px 0 rgba(249, 115, 22, 0.5);
}

.generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Content Output */
.content-output {
    background: var(--background-secondary);
    padding: 4rem 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.output-header {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.output-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.content-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    background: var(--background-primary);
    border: 1px solid var(--border-medium);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.action-btn:hover {
    background: var(--background-tertiary);
    transform: translateY(-1px);
}

.action-btn.liked {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.output-content {
    max-width: 1200px;
    margin: 0 auto;
}

.output-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

.content-section {
    background: var(--background-primary);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.content-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.content-section h4 i {
    font-size: 1.125rem;
}

.content-text {
    color: var(--text-primary);
    line-height: 1.7;
}

.generated-image {
    background: var(--background-primary);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    position: sticky;
    top: 2rem;
}

.image-placeholder {
    background: var(--background-secondary);
    border: 2px dashed var(--border-medium);
    border-radius: var(--border-radius);
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    margin-top: 1rem;
}

.image-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Resources Section */
.resources-section {
    padding: 4rem 2rem;
    background: var(--background-primary);
}

.resources-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.resources-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.resource-card {
    background: var(--background-secondary);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.resource-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.resource-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.resource-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.resource-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.resource-link:hover {
    border-bottom-color: var(--primary-color);
}

/* Journey Section */
.journey-section {
    padding: 4rem 2rem;
    background: var(--background-secondary);
}

.journey-content {
    max-width: 1200px;
    margin: 0 auto;
}

.journey-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
}

.journey-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--background-primary);
    padding: 0.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-light);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--primary-color);
    color: white;
}

.journey-tab-content {
    display: none;
}

.journey-tab-content.active {
    display: block;
}

.journey-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.journey-item {
    background: var(--background-primary);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.journey-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
    background: var(--background-primary);
    color: var(--text-primary);
    padding: 3rem 2rem 2rem;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-secondary);
    margin-top: 2rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--background-primary);
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-medium);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background: var(--background-secondary);
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.voice-indicator {
    margin-bottom: 2rem;
}

.voice-indicator i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.voice-indicator i.pulse {
    animation: pulse 1s infinite;
}

.voice-text {
    background: var(--background-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 100px;
    text-align: left;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.modal-actions {
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--background-tertiary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Loading Animation */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .krik-question {
        font-size: 2.5rem;
    }

    .krak-response {
        padding: 0.75rem 2rem;
        font-size: 1.5rem;
    }

    .generation-form {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .output-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .content-sidebar {
        order: -1;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .journey-tabs {
        flex-direction: column;
    }

    .journey-items {
        grid-template-columns: 1fr;
    }

    .content-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .action-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .output-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}