/* Invitation Page Styles */

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.invitation-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 1.5rem;
    animation: fadeIn 0.5s ease;
}

/* Header */
.invitation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.guest-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 30px;
    display: inline-block;
}

/* Card Styles */
.invitation-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.card-icon {
    font-size: 1.5rem;
}

.card-title {
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
    margin: 0;
}

/* Image Container */
.invitation-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    border-radius: 15px;
    overflow: hidden;
}

.invitation-image {
    max-width: 100%;
    max-height: 450px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.invitation-image:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.no-image-placeholder {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed #dee2e6;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #adb5bd;
}

.no-image-placeholder span {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.no-image-placeholder p {
    font-size: 0.95rem;
}

/* Action Buttons */
.image-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-action.btn-preview {
    background: #1a1a1a;
    color: white;
}

.btn-action.btn-preview:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-action.btn-download {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-action.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Response Buttons */
.response-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-response {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-response.btn-confirm {
    background: linear-gradient(135deg, #1a1a1a, #333);
    color: white;
    border: none;
}

.btn-response.btn-confirm:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btn-response.btn-decline {
    background: white;
    color: #dc3545;
    border: 2px solid #dc3545;
}

.btn-response.btn-decline:hover:not(:disabled) {
    background: #fff5f5;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.2);
}

.btn-response:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Status Message */
.status-message {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1.25rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1rem;
    animation: fadeIn 0.5s ease;
}

.status-message.show {
    display: flex;
}

.status-message.status-accepted {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #b8dacc;
}

.status-message.status-rejected {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #f1b0b7;
}

/* Change Response */
.change-response {
    text-align: center;
    margin-top: 1rem;
}

.btn-change {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.btn-change:hover {
    color: #333;
}

/* Preview Modal */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.preview-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.preview-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

.preview-modal .modal-content {
    position: relative;
    z-index: 1;
    max-width: 95%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-modal .modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.preview-modal .close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px 18px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.preview-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-actions {
    margin-top: 1.5rem;
}

.btn-modal-download {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-modal-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .invitation-page {
        padding: 1rem;
    }
    
    .invitation-card {
        padding: 1.25rem;
    }
    
    .guest-name {
        font-size: 1.2rem;
        padding: 0.4rem 1rem;
    }
    
    .image-actions {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
    
    .response-buttons {
        flex-direction: column-reverse;
    }
    
    .btn-response {
        padding: 14px 16px;
    }
}

/* ========================================
   WhatsApp Bulk Sending Page Styles
   ======================================== */

.whatsapp-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.whatsapp-page .page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.whatsapp-page .page-header h1 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.whatsapp-page .page-header p {
    color: #666;
}

/* Config Status */
.config-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.config-status.configured {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.config-status.not-configured {
    background: #fff3cd;
    border: 1px solid #ffeeba;
}

.status-icon {
    font-size: 2rem;
}

.status-info strong {
    display: block;
    font-size: 1rem;
}

.status-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

/* Summary Cards */
.summary-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    flex: 1;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
}

.summary-card.pending {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.summary-card.sent {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.card-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
}

.card-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Action Buttons for WhatsApp */
.whatsapp-page .action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.whatsapp-page .btn-action {
    flex: 1;
    min-width: 200px;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-test:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-send-all {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.btn-send-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.3);
}

.whatsapp-page .btn-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Progress Section */
.progress-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 30px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #25D366, #128C7E);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.progress-text {
    text-align: center;
    margin-top: 0.75rem;
    color: #333;
}

/* Results Section */
.results-section,
.test-result {
    margin-bottom: 1.5rem;
}

.result-box {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.result-box.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.result-box.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.test-result {
    padding: 1.5rem;
    background: #e7f3ff;
    border: 1px solid #b6d4fe;
    border-radius: 12px;
}

.test-result h4 {
    margin-bottom: 1rem;
    color: #0a58ca;
}

/* Guests Table */
.guests-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.table-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.guests-table {
    width: 100%;
    border-collapse: collapse;
}

.guests-table th,
.guests-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.guests-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
}

.guests-table tr:hover {
    background: #f8f9fa;
}

.phone-formatted {
    direction: ltr;
    font-family: monospace;
    color: #28a745;
}

.thumb-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
}

.no-image {
    color: #999;
    font-size: 0.8rem;
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    margin: 2px;
}

.btn-preview-msg {
    background: #e9ecef;
    color: #333;
}

.btn-test-send {
    background: #17a2b8;
    color: white;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
}

.status-badge.accepted {
    background: #d4edda;
    color: #155724;
}

.status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #adb5bd;
}

.empty-state span {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* Navigation Links */
.navigation-links {
    margin-top: 2rem;
    text-align: center;
}

.navigation-links a {
    color: #007bff;
    text-decoration: none;
}

.navigation-links a:hover {
    text-decoration: underline;
}

/* WhatsApp Modal Overrides */
.whatsapp-page .preview-modal .modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.whatsapp-page .preview-modal .close-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f8f9fa;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #333;
}

/* Preview Info List */
.preview-info {
    margin: 0;
    padding: 0;
    list-style: none;
}

.preview-info li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.preview-info li:last-child {
    border-bottom: none;
}

.preview-info strong {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.preview-info .value {
    word-break: break-all;
    direction: ltr;
}

/* Test Phone Dialog */
.test-phone-dialog {
    max-width: 450px;
    text-align: center;
}

.test-phone-dialog h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.dialog-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
}

.guest-info-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.phone-options {
    text-align: right;
    margin-bottom: 1.5rem;
}

.phone-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.phone-option:hover {
    background: #e9ecef;
}

.phone-option:has(input:checked) {
    border-color: #25D366;
    background: #f0fff4;
}

.phone-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #25D366;
}

.option-label {
    flex: 1;
    font-weight: 600;
}

.option-phone {
    direction: ltr;
    font-family: monospace;
    color: #28a745;
    font-size: 0.9rem;
}

.custom-phone-input {
    padding: 0 1rem;
    margin-top: 0.5rem;
}

.custom-phone-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    text-align: left;
    transition: border-color 0.3s ease;
}

.custom-phone-input input:focus {
    outline: none;
    border-color: #25D366;
}

.phone-hint {
    display: block;
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
    text-align: center;
}

.dialog-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-dialog {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-dialog.btn-cancel {
    background: #f8f9fa;
    color: #333;
}

.btn-dialog.btn-cancel:hover {
    background: #e9ecef;
}

.btn-dialog.btn-send-test {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.btn-dialog.btn-send-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-dialog:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* WhatsApp Page Mobile Responsive */
@media (max-width: 768px) {
    .whatsapp-page {
        padding: 1rem;
    }
    
    .summary-cards {
        flex-direction: column;
    }
    
    .whatsapp-page .action-buttons {
        flex-direction: column;
    }
    
    .whatsapp-page .btn-action {
        min-width: 100%;
    }
    
    .guests-table {
        font-size: 0.85rem;
    }
    
    .guests-table th,
    .guests-table td {
        padding: 0.5rem;
    }
    
    .table-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .test-phone-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .dialog-actions {
        flex-direction: column;
    }
}
