/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #0a0a0a;
    color: #ffffff;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid #333;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00ff88;
}

.nav-logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #00ff88;
}

.btn-outline {
    border: 2px solid #00ff88;
    color: #00ff88;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #00ff88;
    color: #0a0a0a;
}

.btn-login {
    background: #333;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.btn-login:hover {
    background: #444;
}

.nav-mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0 50px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

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

.hero-subtitle {
    font-size: 1.5rem;
    color: #00ff88;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-description {
    font-size: 1.1rem;
    color: #cccccc;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* AI Prompt Section */
.ai-prompt-section {
    margin: 2rem 0;
}

.prompt-container {
    display: flex;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.prompt-container:focus-within {
    border-color: #00ff88;
}

.prompt-input {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
}

.prompt-input::placeholder {
    color: #666;
}

.prompt-btn {
    background: #00ff88;
    color: #0a0a0a;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.model-selector {
    margin: 1rem 0;
}

.model-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary {
    background: #00ff88;
    color: #0a0a0a;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #00cc6a;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #333;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    border-color: #00ff88;
    color: #00ff88;
}

/* Code Preview */
.hero-visual {
    position: relative;
}

.code-preview {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.code-header {
    background: #2d2d2d;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #333;
}

.code-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca3f; }

.code-title {
    color: #cccccc;
    font-size: 0.9rem;
}

.code-content {
    padding: 1.5rem;
}

.code-content pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #00ff88;
}

/* Features Section */
.features {
    padding: 100px 0;
    background: #0f0f0f;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #ffffff;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #333;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: #00ff88;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #00ff88;
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.feature-card p {
    color: #cccccc;
    line-height: 1.6;
}

/* How It Works */
.how-it-works {
    padding: 100px 0;
    background: #0a0a0a;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: #00ff88;
    color: #0a0a0a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.step p {
    color: #cccccc;
    line-height: 1.6;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.large .modal-content {
    max-width: 90%;
    height: 90%;
}

.modal-content {
    background: #1a1a1a;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    border: 1px solid #333;
    position: relative;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #ffffff;
    margin: 0;
}

.close {
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #00ff88;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cccccc;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: #2d2d2d;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffffff;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00ff88;
}

.api-key-result {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #2d2d2d;
    border-radius: 6px;
    font-family: monospace;
}

.api-key-display code {
    flex: 1;
    color: #00ff88;
}

.btn-copy {
    background: transparent;
    border: 1px solid #00ff88;
    color: #00ff88;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #00ff88;
    color: #0a0a0a;
}

.api-key-warning {
    color: #ffbd2e;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Vibe Coding Editor */
.modal.large .modal-content {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.modal.large .modal-body {
    padding: 0;
    flex-grow: 1;
    display: flex;
}

.editor-container {
    position: relative;
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100%;
    width: 100%;
}

.editor-sidebar {
    position: relative;
    max-height: 83vh;
    background: #1e1e1e;
    border-right: 1px solid #333;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.editor-main {
    display: flex;
    flex-direction: column;
}

.prompt-section {
    padding: 1rem;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    height: 260px;
    position: absolute;
    bottom: 0;
    width: -webkit-fill-available;
}

#toolSelector {
    width: 100%;
    padding: 0.75rem;
    background: #2d2d2d;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 1rem;
}

#toolSelector:focus {
    outline: none;
    border-color: #00ff88;
}

.prompt-section textarea {
    width: 100%;
    flex-grow: 1; /* Make textarea fill space */
    background: #2d2d2d;
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffffff;
    padding: 1rem;
    resize: none; /* Disable resize */
    margin-bottom: 0;
}

#vibeGenerate {
    position: absolute;
    bottom: 2rem;
    right: 1.7rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

#vibeGenerate .fa-magic {
    margin-right: 0;
}

#reasoning-section {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid #333;
    color: #cccccc;
    font-size: 0.9rem;
    max-height: 200px; /* Limit height */
    overflow-y: auto; /* Allow scrolling */
    line-height: 1.5;
}

#reasoning-section:empty {
    display: none; /* Hide if there's no reasoning */
}

.typing-cursor::after {
    content: '▋';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.result-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-tabs {
    display: flex;
    background: #2d2d2d;
    border-bottom: 1px solid #333;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #cccccc;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #00ff88;
    border-bottom-color: #00ff88;
}

.result-content {
    flex: 1;
    background: #1a1a1a;
    position: relative;
    min-height: 0; /* Fix for flexbox scrolling */
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content {
    position: relative; /* For positioning copy button */
}

.tab-content.active {
    display: flex; /* Use flexbox for active tab */
    flex-direction: column;
    height: 100%;
}

.btn-copy-code {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #2d2d2d;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.btn-copy-code:hover {
    opacity: 1;
    background: #00ff88;
    color: #0a0a0a;
}

#downloadZipBtn {
    margin-right: 1.5rem;
}

.tab-content pre {
    flex: 1 1 auto; /* Allow pre to grow and shrink */
    min-height: 0; /* Important for allowing shrinkage */
    margin: 0;
    padding: 1rem;
    overflow: auto;
    background: #1a1a1a;
}

.tab-content code {
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

#previewFrame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .nav-mobile-toggle {
        display: block;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .editor-sidebar {
        display: none;
    }
    
    .modal.large .modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }
}