@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.05);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header & Hero */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Form Styles */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 3rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

input, textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1rem;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

button:active {
    transform: translateY(0);
}

/* Results / Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Charts Area */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 600px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
}

h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bar-label {
    flex: 0 0 120px;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-container {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 1s ease-out;
}

.bar-value {
    flex: 0 0 50px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Post Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: scale(1.02);
    border-color: var(--primary);
}

.post-thumb {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: #1e293b;
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-score {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.8rem;
}

.post-caption {
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.post-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.post-link:hover {
    text-decoration: underline;
}

/* Utility */
.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--warning);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #fbbf24;
}

.error-box {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #f87171;
}

.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.6s ease forwards;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
