* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-dark: #0f0f1e;
    --bg-darker: #0a0a15;
    --bg-light: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --border-color: #2a2a3e;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    min-height: 100vh;
    position: relative;
}

/* Landing Section */
.landing-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.landing-section.active {
    opacity: 1;
    transform: translateY(0);
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particles::before,
.particles::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.particles::before {
    background: #667eea;
    top: -100px;
    left: -100px;
}

.particles::after {
    background: #764ba2;
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -100px) scale(1.1); }
    66% { transform: translate(-100px, 100px) scale(0.9); }
}

.hero {
    max-width: 900px;
    width: 100%;
    padding: 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    animation: slideDown 0.8s ease-out;
}

.logo {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.brand-name {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    animation: slideDown 1s ease-out;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
    animation: slideDown 1.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Container */
.input-container {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 1.4s ease-out;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: #667eea;
    box-shadow: 0 5px 30px rgba(102, 126, 234, 0.3);
}

.user-input {
    width: 100%;
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

.user-input:focus {
    outline: none;
    border-color: #667eea;
    background: var(--bg-dark);
}

.user-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.char-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: #667eea;
    background: var(--bg-darker);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

/* Features Preview */
.features-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    animation: fadeInUp 1.6s ease-out;
}

.feature-item {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.feature-text {
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Editor Section */
.editor-section {
    display: none;
    flex-direction: column;
    height: 100vh;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.editor-section.active {
    display: flex;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.project-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.generating {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-badge.completed {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-badge.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.badge {
    background: var(--primary-gradient);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Editor Container */
.editor-container {
    display: grid;
    grid-template-columns: 250px 1fr 400px;
    flex: 1;
    overflow: hidden;
}

.files-panel,
.code-panel,
.preview-panel {
    background: var(--bg-darker);
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.preview-panel {
    border-right: none;
}

.panel-header {
    padding: 15px 20px;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Files List */
.files-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.file-item {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    animation: slideInLeft 0.4s ease;
}

.file-item:hover {
    background: var(--bg-light);
}

.file-item.active {
    background: var(--primary-gradient);
    color: white;
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    flex: 1;
    font-size: 0.95rem;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Code Editor */
.code-editor-container {
    flex: 1;
    overflow: hidden;
}

.code-editor {
    height: 100%;
    overflow: auto;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 20px;
}

.generating-animation {
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    background: var(--primary-gradient);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.code-content {
    animation: fadeIn 0.4s ease;
}

.line-number {
    color: var(--text-secondary);
    opacity: 0.5;
    user-select: none;
    margin-right: 20px;
    display: inline-block;
    width: 30px;
    text-align: right;
}

/* File Tabs */
.tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 0 10px;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
    font-size: 0.9rem;
}

.tab:hover {
    background: var(--bg-darker);
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-darker);
    color: var(--text-primary);
    font-weight: 600;
}

/* Preview Frame */
.preview-controls {
    display: flex;
    gap: 5px;
}

.device-btn {
    padding: 8px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.device-btn:hover {
    border-color: #667eea;
    color: var(--text-primary);
}

.device-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

.preview-frame {
    flex: 1;
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.preview-frame.tablet iframe {
    width: 768px;
    max-width: 100%;
}

.preview-frame.mobile iframe {
    width: 375px;
    max-width: 100%;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: var(--text-secondary);
}

/* Generation Log */
.generation-log {
    background: var(--bg-light);
    border-top: 2px solid var(--border-color);
}

.log-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.log-content.collapsed {
    display: none;
}

.log-message {
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid;
    animation: slideInLeft 0.3s ease;
    font-size: 0.9rem;
}

.log-message.info {
    background: rgba(33, 150, 243, 0.1);
    border-color: #2196f3;
}

.log-message.success {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
}

.log-message.error {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
}

.log-message.warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .editor-container {
        grid-template-columns: 200px 1fr 350px;
    }
}

@media (max-width: 968px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .files-panel,
    .preview-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .features-preview {
        grid-template-columns: 1fr;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 15px;
    }
}
