/* Minimal Bulk Sharing Styles - Function Over Style */

/* Hide wizard steps by default */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

/* Upload area styling (copying Firebase pattern) */
#contactsImageUploadArea {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
    min-height: 150px;
}

#contactsImageUploadArea:hover {
    border-color: #6c757d;
    background: rgba(108, 117, 125, 0.05);
}

#contactsImageUploadArea.drag-over {
    border-color: var(--primary-color, #6941c6);
    background: rgba(105, 65, 198, 0.1);
    transform: scale(1.02);
}

/* Validation results styling */
.stat-item {
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Contact Editor Modal Improvements */
.contact-editor .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.contact-editor .table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #343a40; /* Ensure header background for sticky */
    color: #fff;
}

.contact-editor .table-success td { /* Apply to cells for better visibility */
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.contact-editor .table-danger td { /* Apply to cells for better visibility */
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.contact-editor .delete-contact-btn {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.contact-editor .delete-contact-btn:hover {
    opacity: 1;
}

/* Ensure Add Contact button is always visible */
#addNewContactBtn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important; /* Use inline-flex for icon alignment */
    align-items: center;
}

/* Visual indicators for validation in modal inputs */
.contact-editor .form-control.is-invalid { /* Specific to contact editor */
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.contact-editor .form-control.is-valid { /* Specific to contact editor */
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.message-preview {
    min-height: 150px; /* Ensure previews have some min height */
}

#bulkImageUploadArea {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
#bulkImageUploadArea:hover {
    background-color: #e9ecef !important;
    border-color: #007bff !important;
}

/* Invalid contacts list */
.invalid-list {
    max-height: 200px;
    overflow-y: auto;
}

.invalid-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
}

/* Progress styling */
.wizard-progress {
    margin-top: 1rem;
}

/* Cost calculator sticky positioning */
.cost-calculator {
    position: sticky;
    top: 2rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cost-calculator {
        position: static !important;
        margin-top: 2rem;
    }

    #contactsImageUploadArea {
        min-height: 120px;
    }

    .stat-item {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
}

/* Timeline styles for campaign progress */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 24px;
    height: calc(100% + 0.5rem);
    width: 2px;
    background: #dee2e6;
}

.timeline-item.completed::after {
    background: #28a745;
}

.timeline-item.current::after {
    background: linear-gradient(to bottom, #007bff 50%, #dee2e6 50%);
}

.timeline-item i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    z-index: 1;
    background: white;
}

.timeline-content {
    flex: 1;
}

.timeline-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Add to bulk-sharing.css or main CSS */
.wizard-step {
    min-height: 400px;
}

.wizard-step.active {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#contactsImageUploadArea.drag-over {
    border-color: #6941c6 !important;
    background: rgba(105, 65, 198, 0.1) !important;
    transform: scale(1.02);
}

/* File input completely hidden */
#contactsImageUploadInput {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

/* Upload progress */
.upload-progress {
    padding: 2rem;
}

/* Ensure wizard navigation is properly spaced */
.wizard-navigation {
    border-top: 1px solid #dee2e6;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

/* Additional styles for complete features */

/* Bulk image upload area */
#bulkImageUploadArea {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
    min-height: 150px;
}

#bulkImageUploadArea:hover {
    border-color: #6c757d;
    background: rgba(108, 117, 125, 0.05);
}

#bulkImageUploadArea.drag-over {
    border-color: var(--primary-color, #6941c6);
    background: rgba(105, 65, 198, 0.1);
    transform: scale(1.02);
}

/* Message preview styling */
.message-preview {
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
}

/* Email and WhatsApp preview boxes */
.email-content img,
.whatsapp-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Payment form enhancements */
#payment-form-container {
    min-height: 200px;
}

/* Contact editor modal */
.contact-editor .table-responsive {
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.contact-editor .sticky-top {
    background-color: #212529 !important;
}

/* Success step styling */
.final-step-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Enhanced validation styling */
.invalid-item {
    border-left: 4px solid #dc3545;
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.1) 0%, transparent 100%);
}

/* Progress enhancements */
.wizard-progress .step-label.active {
    color: var(--primary-color, #6941c6);
    font-weight: 600;
}

.wizard-progress .step-label.completed {
    color: #28a745;
    font-weight: 500;
    position: relative;
}

.wizard-progress .step-label.completed::after {
    content: '✓';
    position: absolute;
    right: -15px;
    color: #28a745;
    font-weight: bold;
}

/* Final step enhancements */
.final-step-content .card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.final-step-content .border-end:last-child {
    border-right: none !important;
}

/* Success animations */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.final-step-content .bi-check-circle-fill {
    animation: successPulse 2s ease-in-out;
}

/* Button state improvements */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile enhancements */
@media (max-width: 768px) {
    .contact-editor .table-responsive {
        font-size: 0.875rem;
    }

    .contact-editor input,
    .contact-editor select {
        font-size: 0.875rem;
    }

    .wizard-step h4 {
        font-size: 1.25rem;
    }

    .final-step-content {
        padding: 1rem;
    }
}

/* Animation for step transitions */
.wizard-step.active {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fix for bulk sharing payment button color */
#complete-payment-btn {
  background-color: var(--success-500) !important; /* Use main success color */
  color: white !important;
  border: none !important;
}

#complete-payment-btn:hover {
  background-color: var(--success-600) !important; /* Darker shade on hover */
}

/* Image format instructions styling */
.alert-info {
    border-left: 4px solid #0dcaf0;
}

.alert-info h6 {
    color: #055160;
    margin-bottom: 0.5rem;
}

.alert-info ul {
    padding-left: 1.5rem;
}

.alert-info li {
    margin-bottom: 0.25rem;
}

/* Upload area instructions */
#bulkImageUploadArea small {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Error messages */
.alert-danger {
    border-left: 4px solid #dc3545;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
