/* Dashboard Styles - Main dashboard layout, navigation, cards, grids, statistics */

/* Dashboard Styles */
.dashboard {
    display: none;
    background: var(--gradient-primary);
    min-height: 100vh;
}

.dashboard.active {
    display: block;
}

.dashboard-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.dashboard-logo {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-user-role {
    font-size: 14px;
    color: var(--text-secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* CRITICAL MOBILE FIX - Dashboard Grid Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-action {
    padding: 8px 16px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.card-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.children-grid {
    display: grid;
    gap: 16px;
}

.child-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.child-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.child-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.child-name {
    font-weight: 600;
    color: var(--text-primary);
}

.child-age {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.child-info {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.activity-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.15);
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-icon {
    font-size: 24px;
    margin-right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.message {
    background: #4caf50;
}

.activity-icon.schedule {
    background: #ff9800;
}

.activity-icon.milestone {
    background: #9c27b0;
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.activity-meta {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.child-badge {
    font-size: 0.85em;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.activity-description {
    font-size: 0.95em;
    color: var(--text-primary);
    line-height: 1.4;
    margin-left: 52px;
}

.activity-time {
    font-size: 0.8em;
    color: var(--text-secondary);
    opacity: 0.7;
}

.activity-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.quick-action {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.quick-action-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.quick-action-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.quick-action-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--gradient-secondary);
    border: none;
    cursor: pointer;
    z-index: 999;
    box-shadow: var(--shadow-heavy);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(240, 147, 251, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

.fab-tooltip {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.fab:hover .fab-tooltip {
    opacity: 1;
}

/* Mobile Header Optimization - CRITICAL FIX */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 12px 0; /* Reduced from 20px */
    }
    
    .dashboard-logo {
        font-size: 1.6rem; /* Reduced from 2.2rem */
    }
    
    .dashboard-user {
        gap: 8px; /* Reduced spacing */
    }
    
    .dashboard-user button {
        padding: 6px 12px !important; /* Smaller buttons */
        font-size: 13px !important;
        margin-left: 8px !important; /* Reduced margins */
    }
    
    .user-avatar {
        width: 32px; /* Reduced from 40px */
        height: 32px;
        font-size: 14px;
    }
    
    .dashboard-user-name {
        font-size: 1rem; /* Slightly smaller */
    }
    
    .dashboard-user-role {
        font-size: 12px; /* Smaller role text */
    }
}

/* Extra small mobile optimization */
@media (max-width: 480px) {
    .dashboard-header {
        padding: 8px 0; /* Even smaller padding */
    }
    
    .dashboard-logo {
        font-size: 1.4rem; /* Even smaller logo */
    }
    
    .dashboard-user button {
        padding: 5px 8px !important;
        font-size: 12px !important;
        margin-left: 6px !important;
    }
}

/* Mobile Touch Target and Form Improvements */
@media (max-width: 576px) {
    /* Improve touch targets */
    .card-action {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .quick-action {
        min-height: 100px;
        padding: 24px 20px;
    }
    
    .quick-action-icon {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .quick-action-title {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .quick-action-desc {
        font-size: 13px;
    }
    
    /* Children grid improvements */
    .children-grid {
        gap: 12px;
    }
    
    .child-card {
        padding: 18px;
        min-height: 120px;
    }
    
    .child-name {
        font-size: 16px;
    }
    
    .child-age {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .child-info {
        gap: 12px;
        font-size: 13px;
    }
    
    /* Activity feed improvements */
    .activity-feed {
        max-height: 350px;
    }
    
    .activity-item {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .activity-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        margin-right: 10px;
    }
    
    .activity-header {
        margin-bottom: 10px;
    }
    
    .child-badge {
        font-size: 0.8em;
        padding: 3px 10px;
    }
    
    .activity-description {
        font-size: 0.9em;
        margin-left: 46px;
    }
    
    .activity-title {
        font-size: 15px;
        margin-bottom: 6px;
    }
    
    .activity-time {
        font-size: 13px;
    }
    
    /* Header improvements */
    .dashboard-user-name {
        font-size: 1.1rem;
    }
    
    .user-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    /* Further touch target optimization */
    .card-action {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .quick-action {
        min-height: 90px;
        padding: 20px 16px;
    }
    
    .child-card {
        padding: 16px;
        min-height: 110px;
    }
    
    .activity-item {
        padding: 14px 0;
    }
    
    .activity-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    /* Better spacing for small screens */
    .card-header {
        margin-bottom: 16px;
    }
    
    .dashboard-logo {
        font-size: 1.8rem;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}