/* Custom styles for Commitment Fund */
:root {
    --primary: #6f42c1;
    --accent: #8a2be2;
    --warning-replacement: #00ffff;
    --cyan: #00ffff;
    --teal: #20c997;
}

/* Mobile navbar adjustments */
@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        max-width: 55% !important;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
    
    .navbar-brand i {
        font-size: 0.9rem;
    }
    
    /* Mobile profile name with line break */
    .navbar-nav .dropdown-toggle {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
        white-space: pre-line !important;
        text-align: center !important;
        max-width: 100px !important;
        overflow: hidden !important;
    }
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(111, 66, 193, 0.3);
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 1.1rem;
    margin-top: 1rem;
    text-align: center;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Task card styles */
.task-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-card .card-body {
    padding: 1.25rem !important;
}

.task-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.task-card .task-status {
    position: absolute;
    top: 10px;
    right: 10px;
}

.task-card .countdown {
    font-size: 0.85rem;
}

/* Compact task card styles */
.task-card-compact {
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
    border-radius: 8px;
    overflow: hidden;
}

.task-card-compact:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.35rem 0.75rem rgba(0, 0, 0, 0.2);
}

.task-card-compact .card-body {
    padding: 0.75rem !important;
}

.task-card-compact .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}

.task-card-compact .card-text {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.task-card-compact .countdown {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
}

.task-card-compact .wager-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.task-card-compact .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Dashboard stats */
.stat-card {
    border-radius: 10px;
    height: 100%;
    padding: 1.5rem;
}

.stat-value {
    font-size: 2.5rem;
}

/* Countdown timer */
.countdown-display {
    padding: 1.25rem;
}

.time-block {
    font-size: 2.5rem;
    font-weight: bold;
    background-color: #2c3e50;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.time-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.countdown-expired .time-block {
    background-color: #dc3545;
}

.wager-badge {
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 20px;
    font-weight: bold;
}

/* Responsive adjustments for compact cards */
@media (max-width: 768px) {
    .task-card-compact .card-title {
        font-size: 0.9rem;
    }
    
    .task-card-compact .card-text {
        font-size: 0.75rem;
    }
    
    .task-card-compact .countdown {
        font-size: 0.7rem;
    }
}

.stat-label {
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

/* Completion chart container */
.completion-chart-container {
    height: 200px;
    position: relative;
}

/* Progress bars */
.progress {
    height: 10px;
    border-radius: 5px;
}

/* Media upload */
.media-preview {
    max-height: 300px;
    overflow: hidden;
    border-radius: 8px;
}

.dropzone {
    border: 2px dashed var(--bs-secondary);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.dropzone:hover {
    border-color: var(--bs-primary);
}

/* Admin verification cards */
.verification-card {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
}

.verification-card .proof-thumbnail {
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

/* Custom avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Streak badge */
.streak-badge {
    background: linear-gradient(45deg, var(--bs-primary), var(--bs-success));
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
}

/* Modal z-index and interaction fixes */
.modal {
    z-index: 1055 !important;
}

.modal-dialog {
    z-index: 1060 !important;
    pointer-events: auto !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-content.futuristic-card,
.modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: inherit;
}

.modal-content .btn,
.modal-content button {
    pointer-events: auto !important;
    position: relative;
    z-index: inherit;
}


/* Fix faded appearance in modals by removing backdrop filter */
.modal-content.futuristic-card {
    backdrop-filter: none !important;
    background: var(--surface-light) !important;
}

/* Fix faded appearance of cards inside modals by increasing opacity */
.modal-content .bg-opacity-10 {
    --bs-bg-opacity: 0.3 !important;
}

.modal-content .futuristic-card {
    backdrop-filter: none !important;
}

/* Modal appearance fixes - no backdrop used */
.modal.fade,
.modal.show {
    opacity: 1 !important;
}

/* Admin verify page decision buttons */
.form-check-input {
    display: none !important;
    visibility: hidden !important;
}

/* Show checkboxes for custom days selection, login page, and SMS consent */
#custom_days_section .form-check-input,
#custom-days-section .form-check-input,
#remember_me.form-check-input,
#sms_consent.form-check-input {
    display: inline-block !important;
    visibility: visible !important;
    position: relative !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    margin-right: 0.75rem !important;
    margin-top: 0 !important;
    vertical-align: middle !important;
}

/* Custom days grid layout */
.custom-days-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 0.75rem !important;
    margin-top: 0.5rem !important;
}

.custom-day-item {
    display: flex !important;
    align-items: center !important;
    padding: 0.5rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 0.375rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.custom-day-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.custom-day-item input[type="checkbox"]:checked + label {
    color: var(--cyan) !important;
    font-weight: 500 !important;
}

.custom-day-item:has(input[type="checkbox"]:checked) {
    background: rgba(0, 255, 255, 0.1) !important;
    border-color: var(--cyan) !important;
}

.custom-day-item label {
    margin-bottom: 0 !important;
    cursor: pointer !important;
    user-select: none !important;
    flex: 1 !important;
}

.decision-options {
    display: flex !important;
    gap: 1rem !important;
    justify-content: center !important;
}

.approval-option, .rejection-option {
    flex: 1 !important;
    max-width: 200px !important;
}

.decision-button {
    border: 2px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    background: rgba(59, 130, 246, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px) !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
    width: 100% !important;
    min-height: 120px !important;
}

/* Submit decision button styling */
.futuristic-btn.futuristic-btn-primary {
    border: 2px solid rgba(147, 51, 234, 0.4) !important;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(59, 130, 246, 0.1)) !important;
    backdrop-filter: blur(10px) !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.futuristic-btn.futuristic-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.futuristic-btn.futuristic-btn-primary:hover {
    border-color: rgba(147, 51, 234, 0.8) !important;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(59, 130, 246, 0.2)) !important;
    box-shadow: 0 8px 32px rgba(147, 51, 234, 0.4) !important;
    transform: translateY(-2px) !important;
}

.futuristic-btn.futuristic-btn-primary:hover::before {
    left: 100% !important;
}

.decision-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.decision-button:hover {
    border-color: rgba(147, 51, 234, 0.8) !important;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3) !important;
    transform: translateY(-2px) !important;
}

.decision-button:hover::before {
    left: 100% !important;
}

.approval-option.active .decision-button {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(34, 197, 94, 0.2)) !important;
    border-color: #ffd700 !important;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.approval-option .decision-button:hover {
    border-color: rgba(34, 197, 94, 0.8) !important;
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.4) !important;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.4), rgba(34, 197, 94, 0.2)) !important;
}

.rejection-option.active .decision-button {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(239, 68, 68, 0.2)) !important;
    border-color: #ffd700 !important;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.rejection-option .decision-button:hover {
    border-color: rgba(239, 68, 68, 0.8) !important;
    box-shadow: 0 12px 40px rgba(239, 68, 68, 0.4) !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(239, 68, 68, 0.2)) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-value {
        font-size: 1.8rem;
    }
    
    .completion-chart-container {
        height: 180px;
    }
    
    .decision-options {
        flex-direction: column !important;
    }
    
    .approval-option, .rejection-option {
        max-width: none !important;
    }
    
    .decision-button {
        min-height: 100px !important;
    }
}

/* Futuristic toggle styles */
.futuristic-toggle .futuristic-btn-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.futuristic-toggle .futuristic-btn-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
    transform: translateY(-2px);
}

.futuristic-toggle .btn-check:checked + .futuristic-btn-toggle {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.6);
    color: white;
}

.futuristic-alert {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(138, 43, 226, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
}

.futuristic-alert.alert-warning {
    border-color: rgba(0, 255, 255, 0.5);
    background: rgba(0, 255, 255, 0.1);
}

/* Custom theme replacement classes */
.bg-warning-replaced {
    background-color: var(--cyan) !important;
    color: #000 !important;
}

.text-warning-replaced {
    color: var(--cyan) !important;
}

.border-warning-replaced {
    border-color: var(--cyan) !important;
}

.btn-warning-replaced {
    background-color: var(--cyan) !important;
    border-color: var(--cyan) !important;
    color: #000 !important;
}

.btn-warning-replaced:hover {
    background-color: var(--teal) !important;
    border-color: var(--teal) !important;
    color: #000 !important;
}

.btn-outline-warning-replaced {
    border-color: var(--cyan) !important;
    color: var(--cyan) !important;
}

.btn-outline-warning-replaced:hover {
    background-color: var(--cyan) !important;
    border-color: var(--cyan) !important;
    color: #000 !important;
}

.badge-warning-replaced {
    background-color: var(--cyan) !important;
    color: #000 !important;
}

.progress-bar-warning-replaced {
    background-color: var(--cyan) !important;
}

/* Enhanced readability for setup fee notices */
.setup-fee-notice {
    background: rgba(0, 255, 255, 0.15) !important;
    border: 1px solid rgba(0, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    color: #00ffff !important;
    font-weight: 600 !important;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3) !important;
}

/* Enhanced visibility for small setup fee text in toggle buttons */
.futuristic-btn-toggle small.text-warning-replaced {
    background: rgba(0, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5) !important;
    margin-top: 4px !important;
}

/* Golden selection background for selected plans */
.plan-card-selected {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 193, 7, 0.1)) !important;
    border: 2px solid rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3) !important;
}

/* Enhanced futuristic alert styling for better readability */
.futuristic-alert.alert-warning {
    border-color: rgba(0, 255, 255, 0.6) !important;
    background: rgba(0, 255, 255, 0.15) !important;
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4) !important;
}

.futuristic-alert.alert-success {
    border-color: rgba(25, 135, 84, 0.6) !important;
    background: rgba(25, 135, 84, 0.15) !important;
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(25, 135, 84, 0.4) !important;
}

/* Futuristic button styles */
.btn-futuristic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(147, 51, 234, 0.4);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(59, 130, 246, 0.1));
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-futuristic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-futuristic:hover {
    border-color: rgba(147, 51, 234, 0.8);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(59, 130, 246, 0.2));
    box-shadow: 0 8px 32px rgba(147, 51, 234, 0.4);
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
}

.btn-futuristic:hover::before {
    left: 100%;
}

.btn-futuristic:focus,
.btn-futuristic:active {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(147, 51, 234, 0.25);
    color: #ffffff;
}

.btn-futuristic.btn-outline-secondary {
    border: 2px solid rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.05));
    color: #adb5bd;
}

.btn-futuristic.btn-outline-secondary:hover {
    border-color: rgba(108, 117, 125, 0.8);
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.2), rgba(108, 117, 125, 0.1));
    box-shadow: 0 8px 32px rgba(108, 117, 125, 0.3);
    color: #ffffff;
}

/* Mobile optimizations for task detail page */
@media (max-width: 767.98px) {
    /* Make task detail cards more compact */
    .futuristic-card .card-body {
        padding: 1rem !important;
    }
    
    /* Compact info cards layout */
    .row.g-3.mb-4 .col-md-4.col-6 {
        margin-bottom: 0.5rem !important;
    }
    
    .row.g-3.mb-4 .futuristic-card .card-body {
        padding: 0.5rem !important;
    }
    
    .row.g-3.mb-4 .small.text-muted {
        font-size: 0.7rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .row.g-3.mb-4 .card-body > div:not(.small) {
        font-size: 0.85rem !important;
    }
    
    /* Make wager amount more compact */
    .row.g-3.mb-4 .fs-5 {
        font-size: 1rem !important;
    }
    
    /* Compact alert sections */
    .alert {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    .alert .fa-2x {
        font-size: 1.25rem !important;
    }
    
    .alert .me-3 {
        margin-right: 0.75rem !important;
    }
    
    .alert h5.alert-heading {
        font-size: 1rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .alert p {
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
    }
    
    /* Compact proof description cards */
    .futuristic-card.mb-3 .card-body {
        padding: 0.75rem !important;
    }
    
    .futuristic-card.mb-3 h6 {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .futuristic-card.mb-3 p {
        font-size: 0.8rem !important;
    }
    
    /* Make main task title more compact */
    .card-body h4.mb-3 {
        font-size: 1.25rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.3 !important;
    }
    
    /* Compact main card header */
    .card-header h3.mb-0 {
        font-size: 1.1rem !important;
    }
    
    .card-header .badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Make buttons more compact */
    .btn-futuristic {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Reduce margins and spacing */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .mt-4 {
        margin-top: 1rem !important;
    }
    
    /* Optimize the main container */
    .col-md-10 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Card footer adjustments */
    .card-footer {
        padding: 0.75rem 1rem !important;
    }
}
