/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f56565;
    --dark: #1a202c;
    --light: #f7fafc;
    --gray: #718096;
    --success: #48bb78;
    --warning: #ed8936;
}

body {
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    transition: background 0.3s;
}

body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

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

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dark-mode .navbar {
    background: #1e293b;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

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

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

body.dark-mode .nav-links a {
    color: #e2e8f0;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: white;
}

.nav-btn {
    background: var(--dark);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Hero Section */
.hero {
    padding: 5rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
    }
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

/* Code Window */
.code-window, .preview-window {
    background: #1a202c;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.window-header, .preview-header {
    background: #2d3748;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.window-dots, .preview-dots {
    display: flex;
    gap: 0.5rem;
}

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

.dot.red { background: #f56565; }
.dot.yellow { background: #ed8936; }
.dot.green { background: #48bb78; }

.window-title {
    color: #a0aec0;
    font-size: 0.9rem;
}

.code-content {
    padding: 1.5rem;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
    max-height: 300px;
    overflow-y: auto;
}

/* Templates */
.templates {
    padding: 5rem 0;
    background: var(--light);
}

body.dark-mode .templates {
    background: #0f172a;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

body.dark-mode .section-title {
    color: #e2e8f0;
}

.section-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 3rem;
}

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

.template-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

body.dark-mode .template-card {
    background: #1e293b;
}

.template-card:hover {
    transform: translateY(-10px);
}

.template-preview {
    height: 200px;
    background: #f7fafc;
    padding: 1rem;
}

body.dark-mode .template-preview {
    background: #334155;
}

.preview-content {
    height: 100%;
    background: white;
    border-radius: 5px;
    padding: 1rem;
}

body.dark-mode .preview-content {
    background: #475569;
}

.template-info {
    padding: 1.5rem;
}

.template-info h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

body.dark-mode .template-info h3 {
    color: #e2e8f0;
}

.template-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    margin-top: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Generator */
.generator {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

body.dark-mode .generator {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 1024px) {
    .generator-container {
        grid-template-columns: 1fr;
    }
}

.input-side {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

body.dark-mode .input-side {
    background: #1e293b;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

body.dark-mode .form-group label {
    color: #e2e8f0;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    color: var(--dark);
}

body.dark-mode .form-group select,
body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.color-picker {
    margin: 2rem 0;
}

.color-options {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.3s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--dark);
}

.generator-buttons {
    display: flex;
    gap: 1rem;
}

/* Code Output */
.code-output {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

body.dark-mode .code-output {
    background: #1e293b;
}

.code-tabs {
    display: flex;
    background: #2d3748;
}

.code-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.code-tab.active {
    background: #1a202c;
    color: white;
}

.code-content pre {
    padding: 1.5rem;
    overflow-x: auto;
    background: #1a202c;
    color: #e2e8f0;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    max-height: 300px;
    overflow-y: auto;
}

.code-actions {
    padding: 1rem;
    background: #2d3748;
    display: flex;
    gap: 1rem;
}

/* Features */
.features {
    padding: 5rem 0;
    background: var(--light);
}

body.dark-mode .features {
    background: #0f172a;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

body.dark-mode .feature-card {
    background: #1e293b;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

body.dark-mode .feature-card h3 {
    color: #e2e8f0;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-tagline {
    opacity: 0.8;
    margin-top: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-note {
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    overflow: hidden;
}

body.dark-mode .modal-content {
    background: #1e293b;
}

.modal-header {
    padding: 1.5rem;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem;
    background: #f7fafc;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

body.dark-mode .modal-footer {
    background: #334155;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}