/* Custom styles for Accountability Tracker */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Body and Layout */
html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    line-height: 60px;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.btn-lg {
    padding: 0.75rem 2rem;
}

/* Mission Card */
.mission-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.mission-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Icons */
.bi {
    vertical-align: middle;
}

/* Alert Messages */
.alert {
    border: none;
    border-radius: 8px;
}

/* Hero Section */
.hero-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 15px;
    margin-bottom: 3rem;
}

/* Quick Actions */
.quick-action-card {
    background-color: white;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.quick-action-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

/* Progress Bar */
.progress {
    height: 25px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    font-weight: 600;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }

    .display-4 {
        font-size: 2.5rem;
    }

    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Custom utility classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.gap-3 {
    gap: 1rem;
}

/* Task Management Styles */
.task-list {
    max-height: 600px;
    overflow-y: auto;
}

.task-item {
    background-color: white;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
}

.task-item:hover {
    background-color: #f8f9fa;
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.task-item.completed {
    opacity: 0.7;
    background-color: #f8f9fa;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--secondary-color);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.task-checkbox:checked {
    transform: scale(1.1);
}

/* Habit Checkbox Styling - Improved visibility and UX */
.habit-checkbox {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    cursor: pointer;
    border: 2px solid #6c757d !important;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 0 !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
    border-radius: 4px;
    position: relative;
}

.habit-checkbox:hover {
    border-color: #0d6efd !important;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
    transform: scale(1.05);
}

.habit-checkbox:checked {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.habit-checkbox:checked:hover {
    background-color: #218838 !important;
    border-color: #218838 !important;
}

.habit-checkbox:focus {
    outline: none !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Make the label more clickable */
.habit-item .form-check-label {
    cursor: pointer;
    padding-left: 10px;
    user-select: none;
}

.habit-item .form-check-label:hover {
    color: #0d6efd;
}

/* Add visual feedback for the entire habit item */
.habit-item {
    transition: all 0.3s ease;
    position: relative;
}

.habit-item:hover {
    border-color: #0d6efd !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Checked state styling for the habit container */
.habit-item.bg-success.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.15) !important;
    border-color: #28a745 !important;
}

/* Add a checkmark icon overlay when checked */
.habit-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.task-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.add-task-form {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px dashed #dee2e6;
    transition: border-color 0.3s;
}

.add-task-form:focus-within {
    border-color: var(--primary-color);
    border-style: solid;
}

/* Mission Detail Page Styles */
.mission-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mission-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(45deg);
}

.mission-header h1,
.mission-header h2,
.mission-header h3,
.mission-header h4,
.mission-header h5,
.mission-header h6,
.mission-header p {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.mission-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.mission-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.7);
}

.mission-header .breadcrumb a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.mission-header .breadcrumb a:hover {
    color: white;
}

.progress-section {
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.task-section {
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Enhanced Progress Bar */
.progress {
    height: 30px;
    border-radius: 15px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    font-weight: 600;
    line-height: 30px;
    transition: width 0.6s ease;
}

/* Task Priority Badges */
.task-priority {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.task-priority.high {
    background-color: #fee2e2;
    color: #dc2626;
}

.task-priority.medium {
    background-color: #fef3c7;
    color: #d97706;
}

.task-priority.low {
    background-color: #dbeafe;
    color: #2563eb;
}

/* Empty State */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.5rem;
}

/* Responsive Task Management */
@media (max-width: 768px) {
    .task-list {
        max-height: 400px;
    }

    .task-item {
        font-size: 0.9rem;
    }

    .task-actions {
        opacity: 1;
    }

    .mission-header {
        padding: 1.5rem;
    }

    .progress-section,
    .task-section {
        padding: 1.5rem;
    }
}
