:root {
    /* Colors */
    --color-bg: #0a0a0f;
    --color-surface: #13131a;
    --color-surface-hover: #1a1a24;
    --color-border: #2a2a35;
    --color-text: #e8e8ee;
    --color-text-muted: #9494a8;
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: rgba(99, 102, 241, 0.1);
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-surface: linear-gradient(180deg, #13131a 0%, #0f0f14 100%);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--space-2xl) 0;
}

.grain-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    top: -200px;
    left: -200px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    animation: fadeInUp 1s ease-out;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--color-primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-lg);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    animation: fadeInUp 1s ease-out 0.3s both;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto var(--space-xl);
    animation: fadeInUp 1s ease-out 0.4s both;
}

.cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
}

/* Features Section */
.features-section {
    padding: var(--space-2xl) 0;
    position: relative;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.feature-card {
    background: var(--gradient-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.feature-card h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.feature-card p {
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* Form Section */
.form-section {
    padding: var(--space-2xl) 0;
    background: var(--gradient-surface);
}

.form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-xl);
}

.form-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.form-header h2 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.form-header p {
    color: var(--color-text-muted);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.required {
    color: var(--color-danger);
}

input[type="text"],
input[type="url"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="url"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

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

.competitor-urls {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.btn-submit {
    width: 100%;
    margin-top: var(--space-md);
    position: relative;
}

.btn-submit .btn-loading {
    display: none;
}

.btn-submit.loading .btn-text {
    display: none;
}

.btn-submit.loading .btn-loading {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

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

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

/* Results Section */
.results-section {
    padding: var(--space-2xl) 0;
    animation: fadeInUp 0.6s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.results-header h2 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 700;
}

/* Tabs */
.tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
}

.tab {
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab:hover {
    color: var(--color-text);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.analysis-card {
    background: var(--gradient-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.analysis-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.card-icon {
    font-size: 1.5rem;
}

.card-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.card-subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
}

.analysis-list {
    list-style: none;
}

.analysis-list li {
    padding: var(--space-sm) 0;
    padding-left: var(--space-md);
    position: relative;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.analysis-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

/* Card Colors */
.card-strengths {
    border-color: rgba(16, 185, 129, 0.3);
}

.card-strengths .card-icon {
    color: var(--color-success);
}

.card-weaknesses {
    border-color: rgba(245, 158, 11, 0.3);
}

.card-weaknesses .card-icon {
    color: var(--color-warning);
}

.card-reasons {
    border-color: rgba(239, 68, 68, 0.3);
}

.card-reasons .card-icon {
    color: var(--color-danger);
}

.card-gaps,
.card-elements {
    border-color: rgba(99, 102, 241, 0.3);
}

.card-gaps .card-icon,
.card-elements .card-icon {
    color: var(--color-primary);
}

/* Keywords */
.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.keyword-tag {
    padding: var(--space-xs) var(--space-md);
    background: var(--color-primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Structure List */
.structure-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.structure-item {
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Improved Post */
.improved-post {
    max-width: 900px;
    margin: 0 auto;
}

.meta-info {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.meta-item {
    background: var(--gradient-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
}

.meta-item label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    color: var(--color-text);
    font-size: 1.125rem;
    line-height: 1.6;
    padding-right: 40px;
}

.btn-copy {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-xs);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.preview-header h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.html-preview-container,
.raw-html-container {
    background: var(--gradient-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.html-preview {
    background: white;
    color: #1a1a1a;
    padding: var(--space-xl);
    border-radius: var(--radius-md);
    max-height: 600px;
    overflow-y: auto;
}

.html-preview h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.html-preview h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.html-preview h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.html-preview p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.html-preview ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.raw-html {
    background: var(--color-bg);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    max-height: 400px;
}

.raw-html code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Footer */
.footer {
    padding: var(--space-xl) 0;
    text-align: center;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}

.footer strong {
    color: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        min-height: 80vh;
        padding: var(--space-xl) 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .form-wrapper {
        padding: var(--space-lg);
    }
    
    .tabs {
        gap: 0;
    }
    
    .tab {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Copy Success Toast */
.copy-toast {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    background: var(--color-success);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: slideInUp 0.3s ease-out;
}

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