/* Guardian Sentinel - Parent Dashboard Styles */
:root {
    --primary: #1a56db;
    --primary-dark: #1642a5;
    --danger: #dc2626;
    --warning: #f59e0b;
    --success: #16a34a;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── Auth Pages ─── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1a56db 100%);
}

.auth-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.auth-logo .shield-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background: #f8fafc;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover { background: #b91c1c; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-success {
    background: var(--success);
    color: white;
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.alert-msg {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.alert-msg.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; display: block; }
.alert-msg.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; display: block; }

/* ─── Dashboard Layout ─── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0f172a;
    color: white;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.sidebar-brand h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.sidebar-brand span {
    font-size: 0.8rem;
    color: #94a3b8;
}

.sidebar-nav { flex: 1; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    color: white;
    background: rgba(255,255,255,0.08);
}

.sidebar-nav a.active { border-right: 3px solid var(--primary); }

.sidebar-nav .nav-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }

.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user .user-name { font-size: 0.85rem; }
.sidebar-user .user-email { font-size: 0.75rem; color: #94a3b8; }

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    max-width: 1200px;
}

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

.page-header h1 { font-size: 1.5rem; }

/* ─── Stats Cards ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

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

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.stat-card .stat-sub { font-size: 0.8rem; color: var(--text-muted); }

.stat-card.severity-high .stat-value { color: var(--danger); }
.stat-card.severity-medium .stat-value { color: var(--warning); }
.stat-card.severity-low .stat-value { color: var(--success); }

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 { font-size: 1rem; }
.card-body { padding: 1.25rem; }

/* ─── Alerts Table ─── */
.alerts-table {
    width: 100%;
    border-collapse: collapse;
}

.alerts-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.alerts-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.alerts-table tr:last-child td { border-bottom: none; }
.alerts-table tr.unread { background: #eff6ff; }

.severity-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical { background: #fef2f2; color: #991b1b; border: 1px solid #dc2626; }
.severity-badge.high { background: #fef2f2; color: #991b1b; }
.severity-badge.medium { background: #fffbeb; color: #92400e; }
.severity-badge.low { background: #f0fdf4; color: #166534; }

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ─── Conversations ─── */
.conv-list { display: flex; flex-direction: column; gap: 1rem; }

.conv-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    border-left: 4px solid var(--danger);
}

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

.conv-card .conv-platform { font-weight: 600; }
.conv-card .conv-date { font-size: 0.8rem; color: var(--text-muted); }

.conv-card .conv-reason {
    font-size: 0.9rem;
    color: var(--danger);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.conv-card .conv-snippet {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.conv-card .conv-actions { display: flex; gap: 0.5rem; }

/* ─── Subscription ─── */
.plan-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    border: 2px solid var(--primary);
}

.plan-card .plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0 0.25rem;
}

.plan-card .plan-period { color: var(--text-muted); font-size: 0.9rem; }

.plan-card .plan-features {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
}

.plan-card .plan-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.plan-card .plan-features li::before {
    content: '\2713';
    color: var(--success);
    font-weight: 700;
    margin-right: 0.5rem;
}

.sub-status {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.sub-status.active { background: #f0fdf4; color: #166534; }
.sub-status.inactive { background: #fef2f2; color: #991b1b; }

/* ─── Loading ─── */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ─── Hamburger (mobile) ─── */
.hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hamburger { display: flex; align-items: center; justify-content: center; }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }

    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .alerts-table { font-size: 0.8rem; }
    .alerts-table th, .alerts-table td { padding: 0.5rem; }

    .conv-card .conv-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}

/* ─── Children Page ─── */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}

.child-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    border-left: 4px solid var(--primary);
}

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

.child-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.online { background: var(--success); box-shadow: 0 0 6px rgba(22, 163, 74, 0.5); }
.status-indicator.offline { background: #94a3b8; }

.child-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.child-status.online { background: #f0fdf4; color: #166534; }
.child-status.offline { background: #f1f5f9; color: #64748b; }

.child-details { margin-bottom: 1rem; }

.child-detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.child-detail-row:last-child { border-bottom: none; }

.child-detail-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 110px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.child-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.browser-id-display {
    font-family: 'Courier New', monospace;
    background: #f1f5f9;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text);
    word-break: break-all;
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .children-grid { grid-template-columns: 1fr; }
    .child-detail-row { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 1.5rem; }
}

/* ─── Landing Page ─── */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem;
    background: #0f172a;
    color: white;
    position: sticky;
    top: 0;
    z-index: 50;
}

.landing-nav .nav-brand {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.landing-nav .nav-links { display: flex; gap: 0.75rem; align-items: center; }

.landing-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1a56db 100%);
    color: white;
    text-align: center;
    padding: 5rem 2rem 4rem;
}

.landing-hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    max-width: 720px;
    margin: 0 auto 1.25rem;
    line-height: 1.15;
}

.landing-hero > p {
    font-size: 1.15rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-white { background: white; color: #0f172a; }
.btn-white:hover { background: #e2e8f0; }

.landing-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 0;
}

.landing-stat {
    padding: 1.25rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.landing-stat:last-child { border-right: none; }
.landing-stat strong { display: block; font-size: 1.6rem; margin-bottom: 0.25rem; color: #60a5fa; }

.landing-section {
    padding: 4rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.landing-section h2 { font-size: 1.9rem; margin-bottom: 0.5rem; color: var(--text); }
.landing-section > p { color: var(--text-muted); margin-bottom: 2.5rem; font-size: 1.05rem; }

.landing-section-alt { background: var(--bg); max-width: none; }
.landing-section-alt .landing-inner { max-width: 1100px; margin: 0 auto; }

.landing-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    text-align: left;
}

.landing-category-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-top: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

.landing-category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.landing-category-card .cat-icon { font-size: 1.75rem; margin-bottom: 0.6rem; display: block; }
.landing-category-card h3 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.landing-category-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

.landing-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

.landing-step .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 auto 0.75rem;
}

.landing-step h3 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.landing-step p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

.landing-cta-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
}

.landing-cta-section h2 { font-size: 1.75rem; margin-bottom: 0.75rem; }
.landing-cta-section p { color: #cbd5e1; margin-bottom: 1.5rem; font-size: 1rem; }
.landing-cta-section .hero-ctas { margin-top: 0; }

.landing-footer {
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.82rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.landing-footer a { color: #cbd5e1; text-decoration: none; }
.landing-footer a:hover { color: white; }

@media (max-width: 768px) {
    .landing-hero h1 { font-size: 1.8rem; }
    .landing-hero { padding: 3rem 1.5rem 2.5rem; }
    .landing-stats-bar { grid-template-columns: 1fr 1fr; }
    .landing-stat { border-bottom: 1px solid rgba(255,255,255,0.08); }
    .landing-categories-grid { grid-template-columns: 1fr 1fr; }
    .landing-steps { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .landing-nav .nav-brand { font-size: 0.9rem; }
    .landing-nav .nav-links .btn { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
}

@media (max-width: 480px) {
    .landing-hero h1 { font-size: 1.5rem; }
    .landing-stats-bar { grid-template-columns: 1fr; }
    .landing-categories-grid { grid-template-columns: 1fr; }
    .landing-steps { grid-template-columns: 1fr; }
}

/* ─── Demo Page ─── */
.demo-banner {
    background: linear-gradient(90deg, #f59e0b, #f97316);
    color: white;
    text-align: center;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.demo-banner a { color: white; text-decoration: underline; font-weight: 600; }

.demo-cta-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: white;
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.demo-cta-banner h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.demo-cta-banner p { color: #cbd5e1; margin-bottom: 1.25rem; font-size: 0.9rem; }
.demo-cta-banner .btn { margin: 0 0.4rem; }

.sidebar-demo-label {
    display: inline-block;
    background: #f59e0b;
    color: #0f172a;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
