:root {
    --clr-primary: #00CEC9;      /* Neon Cyan */
    --clr-secondary: #81ECEC;    /* Light Cyan */
    --clr-accent: #E17055;       /* Warm Orange/Red */
    --clr-bg: #0A1A1A;           /* Deep dark cyan tinted background */
    --clr-surface: rgba(20, 40, 40, 0.6);
    --clr-border: rgba(0, 206, 201, 0.2);
    
    --clr-text-main: #FFFFFF;
    --clr-text-muted: #A0B2B2;

    --font-sans: 'Inter', system-ui, sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    background-color: var(--clr-bg);
    color: var(--clr-text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 206, 201, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(225, 112, 85, 0.03) 0%, transparent 40%);
}

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-center { text-align: center; }
.text-muted { color: var(--clr-text-muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.min-h-200 { min-height: 200px; }

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--clr-primary);
}
.brand h1 { font-size: 1.5rem; font-weight: 700; color: var(--clr-text-main); }

.grid-content {
    display: flex;
    gap: 2rem;
    flex: 1;
    overflow: hidden;
}

.editor-section {
    flex: 6;
    display: flex;
    flex-direction: column;
}

.editor {
    flex: 1;
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: var(--clr-text-main);
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    transition: var(--transition);
}
.editor:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 2px rgba(0, 206, 201, 0.1);
}
.editor::placeholder { color: rgba(255,255,255,0.2); }

.stats-section {
    flex: 4;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Glass & Cards */
.glass {
    background: var(--clr-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (max-width: 1200px) {
    .metrics-grid { grid-template-columns: 1fr; }
}

.metric-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}
.m-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clr-text-muted);
    font-weight: 600;
}
.m-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--clr-text-main);
    margin-top: 0.25rem;
    line-height: 1;
}

.group-highlight {
    background: rgba(0, 206, 201, 0.1);
    border-color: rgba(0, 206, 201, 0.4);
}
.group-highlight .m-value { color: var(--clr-primary); }

.analysis-panel {
    padding: 1.5rem;
}
.analysis-panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--clr-secondary);
    border-bottom: 1px solid var(--clr-border);
    padding-bottom: 0.75rem;
}

.badge {
    background: rgba(255,255,255,0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Progress Bars */
.progress-container {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
}

/* Limit Item */
.limit-item {
    margin-top: 1.25rem;
}
.limit-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* Keywords */
.kw-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.kw-row:last-child { border-bottom: none; }
.kw-word { font-weight: 500; }
.kw-count {
    background: rgba(0, 206, 201, 0.15);
    color: var(--clr-primary);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--clr-border);
    color: var(--clr-text-main);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--clr-text-muted);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-text-muted); }

@media (max-width: 968px) {
    .grid-content { flex-direction: column; overflow: visible; }
    .editor-section { flex: none; height: 50vh; }
    .stats-section { flex: none; overflow: visible; padding-right: 0; }
    .app-container { height: auto; padding: 1rem; }
}
