/* Import Modern Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables for Design System */
: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%);
    --dark-bg: #0f0f23;
    --darker-bg: #050510;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --text-muted: #6e6e8e;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    --border-radius: 12px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
body.light-theme {
    --dark-bg: #f5f5f7;
    --darker-bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.1);
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --text-muted: #86868b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--darker-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition-smooth);
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundPulse 10s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Styles */
.header {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.logo-icon {
    width: 32px;
    height: 32px;
    stroke: #667eea;
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.5));
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.btn-icon-only {
    padding: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-only:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.btn-icon-only svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* Hero Section */
.hero-section {
    padding: 60px 0;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
}

.hero-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-content {
    padding-right: 24px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

.hero-feature svg {
    width: 20px;
    height: 20px;
    stroke: #4facfe;
    flex-shrink: 0;
}

.hero-image {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Main Container */
.main-container {
    padding: 40px 0;
}

/* Editor Container */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 0 auto 64px;
    max-width: 1400px;
    padding: 0 24px;
}

.panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.panel:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-lg);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--card-border);
}

.tool-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

.tool-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.tool-btn:hover svg {
    stroke: #667eea;
}

.editor-stats {
    display: flex;
    gap: 20px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--card-border);
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Markdown Input */
.markdown-input {
    flex: 1;
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 15px;
    resize: none;
    outline: none;
    line-height: 1.6;
}

.markdown-input::placeholder {
    color: var(--text-muted);
}

/* Markdown Preview */
.markdown-preview {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    color: var(--text-primary);
}

.markdown-preview::-webkit-scrollbar {
    width: 8px;
}

.markdown-preview::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.markdown-preview::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.markdown-preview::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* Markdown Preview Styles */
.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-preview h1 {
    font-size: 32px;
    color: #667eea;
}

.markdown-preview h2 {
    font-size: 26px;
    color: #7c8aee;
}

.markdown-preview h3 {
    font-size: 22px;
    color: #9196f2;
}

.markdown-preview h4 {
    font-size: 18px;
}

.markdown-preview p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.markdown-preview a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition-smooth);
}

.markdown-preview a:hover {
    border-bottom-color: #667eea;
}

.markdown-preview code {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #f5576c;
    font-family: 'Consolas', 'Monaco', monospace;
}

.markdown-preview pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.markdown-preview pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

.markdown-preview blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-preview ul,
.markdown-preview ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.markdown-preview li {
    margin-bottom: 8px;
}

.markdown-preview strong {
    color: #667eea;
    font-weight: 600;
}

.markdown-preview em {
    color: #f5576c;
}

.markdown-preview table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
}

.markdown-preview th,
.markdown-preview td {
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    text-align: left;
}

.markdown-preview th {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.markdown-preview img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.markdown-preview hr {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 24px 0;
}

/* SEO Content */
.seo-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.content-block {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}

.content-block h2 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
}

.content-block h3 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.content-block p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.feature-card {
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: var(--transition-smooth);
}

.feature-card:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 16px;
    display: block;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.feature-list {
    list-style: none;
    margin-left: 0;
}

.feature-list li {
    color: var(--text-secondary);
    padding: 16px 0;
    border-bottom: 1px solid var(--card-border);
    line-height: 1.8;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list strong {
    color: #667eea;
}

.numbered-list {
    list-style: none;
    counter-reset: item;
    margin-left: 0;
}

.numbered-list li {
    counter-increment: item;
    padding: 16px 0 16px 48px;
    position: relative;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-secondary);
    line-height: 1.8;
}

.numbered-list li:last-child {
    border-bottom: none;
}

.numbered-list li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 16px;
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.numbered-list strong {
    color: #667eea;
}

.syntax-table {
    overflow-x: auto;
    margin-top: 24px;
}

.syntax-table table {
    width: 100%;
    border-collapse: collapse;
}

.syntax-table th,
.syntax-table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--card-border);
}

.syntax-table th {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}

.syntax-table td {
    color: var(--text-secondary);
}

.syntax-table code {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #f5576c;
}

.faq-section {
    margin-top: 24px;
}

.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 12px;
}

.faq-item p {
    margin: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    z-index: 1;
}

.modal-header h2 {
    margin: 0;
    color: #667eea;
    font-size: 24px;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: #667eea;
}

.modal-body {
    padding: 24px;
}

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

.cheatsheet-section {
    background: rgba(102, 126, 234, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.cheatsheet-section h3 {
    color: #667eea;
    font-size: 16px;
    margin-bottom: 12px;
}

.cheatsheet-section code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Footer */
.footer {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--card-border);
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    margin-top: 64px;
}

.footer p {
    margin-bottom: 8px;
}

.footer-links {
    margin-top: 12px;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: #764ba2;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-section .container {
        grid-template-columns: 1fr;
    }

    .hero-image {
        order: -1;
    }

    .hero-content {
        padding-right: 0;
        text-align: center;
    }

    .hero-features {
        justify-content: center;
    }
}

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

    .hero-title {
        font-size: 36px;
    }

    .content-block {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: center;
    }

    .logo {
        justify-content: center;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-wrap: wrap;
    }

    .cheatsheet-grid {
        grid-template-columns: 1fr;
    }
}