/* Reset & Variables */
:root {
    --bg-dark: #0f172a;       /* Slate 900 */
    --bg-medium: #1e293b;     /* Slate 800 */
    --text-light: #f8fafc;    /* Slate 50 */
    --text-medium: #94a3b8;   /* Slate 400 */
    --border-color: #334155;  /* Slate 700 */
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --accent-green: #4ade80;
    --accent-red: #f87171;
    --accent-yellow: #facc15;
}

body {
    width: 360px; /* Slightly wider */
    height: auto;
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-medium);
}

.logo-area { display: flex; align-items: center; gap: 8px; }
.logo { width: 22px; height: 22px; }
.brand-name { font-weight: 700; font-size: 15px; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.user-info { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.user-name { color: var(--text-medium); max-width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 9px;
    border: 1px solid transparent;
}
.badge-free { background: rgba(255, 255, 255, 0.1); color: var(--text-medium); border-color: var(--border-color); }
.badge-pro { background: rgba(37, 99, 235, 0.15); color: #60a5fa; border-color: rgba(37, 99, 235, 0.3); }

/* Main Content */
main { padding: 18px; text-align: center; min-height: 200px; }

.hidden { display: none; }

/* Login View */
.login-icon { color: var(--text-medium); margin-bottom: 10px; }
.icon-box svg { width: 48px; height: 48px; }

/* Button */
.gradient-button {
    width: 100%;
    padding: 10px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s, opacity 0.2s;
}
.gradient-button:hover { opacity: 0.9; transform: translateY(-1px); }
.big-btn { padding: 12px; font-size: 15px; }

.helper-text { color: var(--text-medium); font-size: 12px; margin-bottom: 15px; }

/* Results Area */
.result-container { margin-top: 20px; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.video-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: var(--text-light);
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.full-width { grid-column: span 2; flex-direction: row; justify-content: space-between; padding: 10px 15px; }

.stat-card .label { font-size: 10px; color: var(--text-medium); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.full-width .label { margin-bottom: 0; margin-right: 10px; }

.stat-card .value { font-size: 18px; font-weight: bold; color: var(--text-light); }
.value-text { font-size: 14px; font-weight: bold; color: var(--text-light); margin-left: 10px; }

/* SEO Bar */
.seo-bar-container { flex-grow: 1; display: flex; align-items: center; }
.seo-bar-bg { flex-grow: 1; height: 6px; background: var(--bg-dark); border-radius: 3px; overflow: hidden; }
.seo-bar-fill { height: 100%; background: var(--accent-green); border-radius: 3px; transition: width 1s ease-out; }

/* Upgrade Msg */
.upgrade-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.2);
    border-radius: 8px;
    padding: 10px;
    text-align: left;
    margin-bottom: 15px;
}
.upgrade-msg svg { color: var(--accent-yellow); flex-shrink: 0; }
.upgrade-msg p { margin: 0; font-size: 11px; color: var(--text-light); }
.upgrade-msg a { font-size: 11px; font-weight: bold; color: var(--accent-yellow); text-decoration: none; }
.upgrade-msg a:hover { text-decoration: underline; }

.details-link { display: block; text-align: center; color: #60a5fa; text-decoration: none; font-size: 12px; font-weight: 500; }
.details-link:hover { text-decoration: underline; }

/* Footer */
footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-medium);
}
.footer-links { display: flex; gap: 10px; }
footer a { color: var(--text-medium); text-decoration: none; font-size: 11px; transition: color 0.2s; }
footer a:hover { color: var(--text-light); }
.powered-by { font-size: 10px; color: var(--text-medium); }
.ai-text { color: #a78bfa; font-weight: 600; }