/* Parent Dashboard Specific Styles */

.section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
}

/* Children Grid - Rectangular Row Layout */
.children-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.child-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.child-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.child-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    min-width: 80px;
}

/* Parent page avatar images - smaller than child page */
.child-card .avatar-image-container {
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
}

.child-card .avatar-status-badge {
    width: 32px;
    height: 32px;
    font-size: 26px;
    top: -6px;
    right: -6px;
}

.child-avatar {
    font-size: 36px;
}

.child-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0;
    text-align: center;
}

.child-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.child-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.child-card h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.child-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.theme-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
    align-self: flex-start;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin: 0;
}

/* Topics List */
.topics-list {
    margin-top: 20px;
}

.topic-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.topic-info {
    flex: 1;
    min-width: 0;
}

.topic-info h4 {
    margin: 0 0 5px;
    color: #333;
}

.topic-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: #667eea;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-top: 0;
    color: #667eea;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Rewards Section */
.rewards-section {
    margin-top: 20px;
}

.rewards-section h3 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
}

.rewards-section p {
    margin: 10px 0;
}

/* History */
.history-list {
    margin-top: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.history-item span {
    color: #666;
}

/* Progress Report */
.progress-report {
    margin-top: 20px;
}

.progress-report h3 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
}

.progress-report p {
    margin: 10px 0;
}

.milestones-list {
    margin-top: 15px;
}

.milestone-item {
    display: flex;
    gap: 15px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 10px;
}

.milestone-icon {
    font-size: 32px;
}

.milestone-item p {
    margin: 5px 0;
}

.milestone-date {
    color: #666;
    font-size: 12px;
}

/* Progression Notes */
.progression-notes-list {
    margin-top: 15px;
}

.progression-note-item {
    display: flex;
    gap: 15px;
    padding: 10px;
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    margin-bottom: 10px;
}

.note-icon {
    font-size: 24px;
    line-height: 1;
}

.progression-note-item p {
    margin: 5px 0;
}

.note-date {
    color: #666;
    font-size: 11px;
}

.topic-tag {
    display: inline-block;
    background: #4a90e2;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 8px;
    text-transform: uppercase;
}

/* Analytics Dashboard */
.analytics-controls {
    margin-bottom: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
}

.analytics-controls label {
    margin-right: 10px;
    font-weight: 600;
}

.analytics-controls select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.analytics-dashboard {
    padding: 20px 0;
}

.analytics-section {
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.analytics-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.topic-analytics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.topic-analytics-card {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
}

.topic-analytics-card h4 {
    margin-top: 0;
    color: #333;
}

.topic-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
    font-size: 14px;
}

.strengths {
    margin-top: 10px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
    font-size: 13px;
    color: #2e7d32;
}

.weaknesses {
    margin-top: 10px;
    padding: 10px;
    background: #fff3e0;
    border-radius: 4px;
    font-size: 13px;
    color: #e65100;
}

/* Activity Calendar */
.activity-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    gap: 4px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    max-width: 100%;
}

.activity-day {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.activity-day:hover {
    transform: scale(1.1);
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
    z-index: 10;
}

/* Activity intensity levels */
.activity-day.level-0 {
    background: #ebedf0;
    color: #aaa;
}

.activity-day.level-1 {
    background: #c6e48b;
    color: #2d5016;
}

.activity-day.level-2 {
    background: #7bc96f;
    color: #1a3d0f;
}

.activity-day.level-3 {
    background: #239a3b;
    color: white;
}

.activity-day.level-4 {
    background: #196127;
    color: white;
}

.day-number {
    user-select: none;
}

.activity-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.legend-label {
    margin: 0 4px;
}

.activity-legend .activity-day {
    width: 12px;
    height: 12px;
    min-width: 12px;
    font-size: 0;
}

.bar-label {
    font-size: 11px;
    margin-top: 5px;
    color: #666;
    writing-mode: horizontal-tb;
    transform: rotate(-45deg);
    transform-origin: top left;
}

/* Time Pattern */
.time-pattern {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.time-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.time-label {
    width: 100px;
    font-weight: 600;
    text-transform: capitalize;
}

.time-bar {
    flex: 1;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.time-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2 0%, #357abd 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
}

.time-count {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* Streak Info */
.streak-info {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.streak-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.streak-icon {
    font-size: 48px;
}

.streak-value {
    font-size: 36px;
    font-weight: bold;
}

.streak-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .children-grid {
        grid-template-columns: 1fr;
    }

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

    .tabs {
        overflow-x: auto;
    }

    .tab-btn {
        white-space: nowrap;
    }
}

/* Cost Summary */
.cost-summary-section {
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.cost-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
}

.cost-summary-header:hover {
    background: #e9ecef;
    border-radius: 10px 10px 0 0;
}

.cost-summary-header h4 {
    margin: 0;
}

.cost-summary-toggle {
    font-size: 14px;
    color: #667eea;
    transition: transform 0.2s;
}

.cost-summary-content {
    padding: 0 20px 20px 20px;
}

.cost-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.cost-child-name {
    font-weight: 500;
    color: #333;
}

.cost-amount {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #667eea;
}

.cost-total {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    font-size: 18px;
}
