/* ParentPane — Unified Parental Controls Dashboard */

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    
    /* Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    /* Transitions */
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    position: fixed;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--gray-700);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-plan {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Main Content */
.main {
    flex: 1;
    margin-left: 240px;
    padding: var(--space-8);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-1);
}

.header-right {
    display: flex;
    gap: var(--space-3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

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

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

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

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

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

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

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: var(--info-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.purple { background: #ede9fe; }
.stat-icon.orange { background: var(--warning-light); }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Sections */
.section {
    margin-bottom: var(--space-8);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

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

/* Children Grid */
.children-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.child-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.child-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.child-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.child-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.child-info {
    flex: 1;
}

.child-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.child-age {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.child-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8rem;
    padding: var(--space-1) var(--space-3);
    border-radius: 20px;
}

.child-status.online {
    background: var(--success-light);
    color: var(--success);
}

.child-status.offline {
    background: var(--gray-100);
    color: var(--gray-500);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.child-activity {
    padding: var(--space-3);
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

.activity-current {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9rem;
    margin-bottom: var(--space-2);
}

.activity-current.inactive {
    color: var(--text-muted);
}

.platform-icon {
    font-size: 1.1rem;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Progress Bars */
.child-limits {
    margin-bottom: var(--space-4);
}

.limit-bar {
    margin-bottom: var(--space-2);
}

.limit-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: var(--space-2);
}

.limit-remaining {
    font-weight: 600;
}

.limit-remaining.good { color: var(--success); }
.limit-remaining.warning { color: var(--warning); }
.limit-remaining.danger { color: var(--danger); }

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-fill.good { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* Platform Badges */
.child-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.platform-badge {
    padding: var(--space-1) var(--space-3);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.platform-badge.ps { background: #003791; color: white; }
.platform-badge.xbox { background: #107c10; color: white; }
.platform-badge.nintendo { background: #e60012; color: white; }
.platform-badge.roblox { background: #7c3aed; color: white; }
.platform-badge.youtube { background: #ff0000; color: white; }
.platform-badge.minecraft { background: #5d7c3b; color: white; }
.platform-badge.pbs { background: #0066b2; color: white; }

/* Child Actions */
.child-actions {
    display: flex;
    gap: var(--space-2);
}

.child-actions .btn-sm {
    flex: 1;
    justify-content: center;
}

/* Platforms Grid */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

.platform-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.platform-card:hover {
    box-shadow: var(--shadow-md);
}

.platform-card.pending {
    opacity: 0.7;
    border: 2px dashed var(--gray-300);
}

.platform-icon-large {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
}

.platform-name {
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.platform-status {
    font-size: 0.8rem;
    color: var(--success);
    margin-bottom: var(--space-2);
}

.platform-status.pending {
    color: var(--warning);
}

.platform-children {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Activity List */
.activity-list {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.activity-icon.alert { background: var(--danger-light); }
.activity-icon.request { background: var(--warning-light); }
.activity-icon.info { background: var(--info-light); }
.activity-icon.success { background: var(--success-light); }

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.9rem;
}

.activity-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: var(--space-1);
}

.activity-actions {
    display: flex;
    gap: var(--space-2);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5);
    border-bottom: 1px solid var(--gray-100);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-5);
    border-top: 1px solid var(--gray-100);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: white;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 1200px) {
    .children-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .platforms-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: var(--space-2);
    }
    
    .logo-text,
    .nav-item span:not(.nav-icon),
    .user-details {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
    }
    
    .main {
        margin-left: 80px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .children-grid,
    .platforms-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
