:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(51, 65, 85, 0.8);
    --font-main: 'Outfit', sans-serif;
    --gradient-1: #3b82f6;
    --gradient-2: #8b5cf6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effect */
.background-gradient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, rgba(15, 23, 42, 0) 50%);
    z-index: -1;
    animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0.5; }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.highlight {
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Glassmorphism Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Editor Section */
.editor-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-2px);
}

textarea {
    width: 100%;
    height: 300px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-main);
    resize: vertical;
    outline: none;
    line-height: 1.6;
}

textarea::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.status-bar {
    border-top: 1px solid var(--glass-border);
    padding-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: right;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: var(--card-hover);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.primary-stat {
    grid-column: span 2;
    flex-direction: row;
    gap: 1.5rem;
    text-align: left;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .primary-stat {
        grid-column: span 1;
        flex-direction: column;
        text-align: center;
    }
}

.icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.stat-content h3 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
}

/* Advanced Metrics */
.advanced-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

@media (max-width: 768px) {
    .advanced-metrics {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    padding: 1.5rem;
}

.metric-card h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.time-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.time-value {
    font-weight: 600;
    color: var(--accent-color);
}

/* Keyword Density */
.density-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.density-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.density-list li {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.density-list li:last-child {
    border-bottom: none;
}

.empty-state {
    display: block !important;
    text-align: center;
    padding: 2rem !important;
    color: var(--text-secondary);
    font-style: italic;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
