/* Family Hub Custom Styles */

:root {
    --primary-color: #6f42c1;
    --primary-light: #8e62d4;
    --primary-dark: #5a359a;
    --accent-color: #fd7e14;
    --success-color: #20c997;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --family-bg: #f8f9fa;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

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

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

/* Family-themed components */
.family-card {
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.family-card:hover {
    transform: translateY(-2px);
}

.task-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s ease-in-out;
}

.task-card.completed {
    border-left-color: var(--success-color);
    opacity: 0.8;
}

.task-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Weekly goals progress */
.goal-progress {
    height: 20px;
    border-radius: 10px;
    background-color: #e9ecef;
    overflow: hidden;
}

.goal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.goal-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.goal-progress-bar.updating::after {
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Button animation states */
.progress-update-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-update-btn.updating {
    transform: scale(0.95);
    opacity: 0.8;
}

.progress-update-btn.success {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: white !important;
    transform: scale(1.05);
}

.progress-update-btn.error {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: white !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Progress text animation */
.progress-text {
    transition: all 0.3s ease;
}

.progress-text.updating {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Reactions */
.reaction-btn {
    border: none;
    background: none;
    font-size: 1.2em;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    transition: all 0.2s ease-in-out;
}

.reaction-btn:hover {
    background-color: rgba(111, 66, 193, 0.1);
    transform: scale(1.1);
}

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

/* Avatar styles */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-light);
    color: white;
    font-weight: 600;
}

.avatar.sm {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

.avatar.lg {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
}

/* Family role badges */
.role-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.role-badge.admin {
    background-color: var(--accent-color);
    color: white;
}

.role-badge.parent {
    background-color: var(--primary-light);
    color: white;
}

.role-badge.child {
    background-color: var(--success-color);
    color: white;
}

/* Points and gamification */
.points-badge {
    background: linear-gradient(45deg, var(--accent-color), #ff9500);
    color: white;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Romance mode toggle (subtle) */
.romance-mode {
    background: linear-gradient(45deg, #ff6b9d, #c44569);
}

/* Age-appropriate UI adjustments */
.child-ui .btn {
    min-height: 48px;
    font-size: 1.1rem;
}

.child-ui .card {
    border-radius: 20px;
}

.child-ui .form-control {
    min-height: 48px;
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .family-card {
        margin-bottom: 1rem;
    }

    .task-card {
        margin-bottom: 0.75rem;
    }
}

/* Animation helpers */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 0.6s;
}

/* Better contrast for secondary elements - applies globally */
.btn-outline-secondary {
    color: #495057 !important;
    border-color: #495057 !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background-color: #495057 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

/* Fix secondary badge contrast */
.badge.bg-secondary {
    background-color: #495057 !important;
    color: #ffffff !important;
}

/* Fix secondary text contrast */
.text-secondary {
    color: #495057 !important;
}

/* Improve text-muted contrast */
.text-muted {
    color: #6c757d !important;
}

/* Force light mode option - add 'force-light' class to body to override dark mode */
body.force-light {
    background-color: #ffffff !important;
    color: #000000 !important;
}

body.force-light .card,
body.force-light .modal-content {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #dee2e6 !important;
}

body.force-light .form-control {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #ced4da !important;
}

body.force-light .form-label,
body.force-light h1, body.force-light h2, body.force-light h3,
body.force-light h4, body.force-light h5, body.force-light h6,
body.force-light p, body.force-light span, body.force-light div, body.force-light label {
    color: #000000 !important;
}

/* Enhanced secondary elements contrast for force-light mode */
body.force-light .btn-outline-secondary {
    color: #343a40 !important;
    border-color: #343a40 !important;
}

body.force-light .btn-outline-secondary:hover,
body.force-light .btn-outline-secondary:focus,
body.force-light .btn-outline-secondary:active {
    background-color: #343a40 !important;
    border-color: #343a40 !important;
    color: #ffffff !important;
}

body.force-light .badge.bg-secondary {
    background-color: #343a40 !important;
    color: #ffffff !important;
}

body.force-light .text-secondary {
    color: #343a40 !important;
}

body.force-light .text-muted {
    color: #495057 !important;
}

/* Dark mode disabled - forcing light mode only */
/* @media (prefers-color-scheme: dark) { */
    :root {
        --family-bg: #1a1a1a;
    }

    body {
        background-color: #1a1a1a !important;
        color: #ffffff !important;
    }

    .card {
        background-color: #2d2d2d !important;
        border-color: #404040 !important;
        color: #ffffff !important;
    }

    .modal-content {
        background-color: #2d2d2d !important;
        border-color: #404040 !important;
        color: #ffffff !important;
    }

    .form-control {
        background-color: #404040 !important;
        border-color: #666666 !important;
        color: #ffffff !important;
    }

    .form-control:focus {
        background-color: #404040 !important;
        border-color: var(--primary-color) !important;
        color: #ffffff !important;
        box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25) !important;
    }

    .form-label {
        color: #ffffff !important;
    }

    .text-muted {
        color: #ced4da !important;
    }

    .text-secondary {
        color: #ced4da !important;
    }

    .badge.bg-secondary {
        background-color: #6c757d !important;
        color: #ffffff !important;
    }

    .text-dark {
        color: #ffffff !important;
    }

    .bg-light {
        background-color: #2d2d2d !important;
    }

    .border {
        border-color: #404040 !important;
    }

    .alert {
        color: #ffffff !important;
    }

    .alert-success {
        background-color: rgba(32, 201, 151, 0.2) !important;
        border-color: var(--success-color) !important;
    }

    .alert-danger {
        background-color: rgba(220, 53, 69, 0.2) !important;
        border-color: var(--danger-color) !important;
    }

    .btn-outline-secondary {
        color: #495057 !important;
        border-color: #495057 !important;
    }

    .btn-outline-secondary:hover {
        background-color: #495057 !important;
        border-color: #495057 !important;
        color: #ffffff !important;
    }

    .navbar-light {
        background-color: #2d2d2d !important;
    }

    .navbar-light .navbar-brand,
    .navbar-light .navbar-nav .nav-link {
        color: #ffffff !important;
    }

    /* Fix any remaining text contrast issues */
    h1, h2, h3, h4, h5, h6, p, span, div, label, small {
        color: inherit !important;
    }

    /* Ensure buttons maintain readability */
    .btn-primary {
        color: #ffffff !important;
    }

    .btn-secondary {
        background-color: #6c757d !important;
        border-color: #6c757d !important;
        color: #ffffff !important;
    }

    .btn-outline-secondary {
        color: #ffffff !important;
        border-color: #6c757d !important;
    }

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus,
    .btn-outline-secondary:active {
        background-color: #6c757d !important;
        border-color: #6c757d !important;
        color: #ffffff !important;
    }

    /* Fix navbar dropdown and avatar styling in dark mode */
    .navbar-light .navbar-nav .dropdown-menu {
        background-color: #2d2d2d !important;
        border-color: #404040 !important;
    }

    .navbar-light .navbar-nav .dropdown-item {
        color: #ffffff !important;
    }

    .navbar-light .navbar-nav .dropdown-item:hover,
    .navbar-light .navbar-nav .dropdown-item:focus {
        background-color: #404040 !important;
        color: #ffffff !important;
    }

    .navbar-light .navbar-nav .dropdown-divider {
        border-color: #404040 !important;
    }

    /* Fix avatar and user info in dark mode */
    .avatar {
        background-color: var(--primary-color) !important;
        color: #ffffff !important;
    }

    .navbar-light .navbar-nav .nav-link .text-muted {
        color: #ced4da !important;
    }

    /* Fix navbar toggle in dark mode */
    .navbar-light .navbar-toggler {
        border-color: #666666 !important;
    }

    .navbar-light .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }
} */