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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e4e4e7;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, #a855f7, #ec4899, #f43f5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.tagline {
    color: #a1a1aa;
    font-size: 1.1rem;
}

.credit {
    color: #71717a;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

main {
    flex: 1;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
}

.tab.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    color: #e4e4e7;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.chat-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.messages {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.message {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    background: rgba(168, 85, 247, 0.2);
    margin-left: 2rem;
}

.message.assistant {
    background: rgba(255, 255, 255, 0.1);
    margin-right: 2rem;
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.prompt-form {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    color: #e4e4e7;
    font-size: 1rem;
    resize: none;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #a855f7;
}

textarea::placeholder {
    color: #71717a;
}

button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#submitBtn {
    background: linear-gradient(90deg, #a855f7, #ec4899);
    color: white;
}

#submitBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

#submitBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

.project-panel {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-panel h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-status {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.project-status.generating {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.project-status.ready {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.project-status.deploying {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.project-status.deployed {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.project-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.project-files {
    margin-bottom: 1rem;
}

.file-item {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.file-item:hover {
    background: rgba(0, 0, 0, 0.3);
}

.file-content {
    display: none;
    margin-top: 0.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 0.5rem;
    white-space: pre-wrap;
    overflow-x: auto;
    font-size: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
}

.file-item.expanded .file-content {
    display: block;
}

.project-actions {
    margin-top: 1rem;
}

.deploy-btn {
    background: linear-gradient(90deg, #0061fe, #00b4d8);
    color: white;
    width: 100%;
}

.deploy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 97, 254, 0.4);
}

.deploy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.deployed-url {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 0.75rem;
    text-align: center;
}

.deployed-url a {
    color: #22c55e;
    font-weight: 600;
    text-decoration: none;
}

.deployed-url a:hover {
    text-decoration: underline;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.projects-list .loading {
    text-align: center;
    color: #71717a;
    padding: 2rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.project-card-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.project-card-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    font-weight: 600;
}

.project-card-status.generating {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.project-card-status.ready {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.project-card-status.deploying {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.project-card-status.deployed {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.project-card-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.project-card-description {
    color: #a1a1aa;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #71717a;
}

.project-card-link {
    color: #a855f7;
    text-decoration: none;
}

.project-card-link:hover {
    text-decoration: underline;
}

.project-card-actions {
    display: flex;
    gap: 0.5rem;
}

.project-card-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 0.5rem;
}

.project-card-btn.delete {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.project-card-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #71717a;
}

.empty-state p {
    margin-bottom: 1rem;
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: #52525b;
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        text-align: center;
    }
}

