/**
 * COD Order Form Styles
 * Professional, conversion-optimized design
 */

.cod-order-form-wrapper {
    max-width: 600px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.cod-form-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 30px;
    position: relative;
}

/* Header */
.cod-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.cod-form-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.cod-form-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

/* Countdown Timer */
.cod-countdown-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    color: #92400e;
    animation: pulse 2s infinite;
}

.cod-timer-icon {
    font-size: 20px;
}

.cod-timer-display {
    font-size: 18px;
    font-weight: 700;
    color: #dc2626;
}

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

/* Trust Badges */
.cod-trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.cod-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

.cod-badge-icon {
    font-size: 32px;
}

.cod-badge-text {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

/* Form Section */
.cod-form-section {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.cod-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.cod-section-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

/* Form Groups */
.cod-form-group {
    margin-bottom: 20px;
}

.cod-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.cod-input,
.cod-select,
.cod-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1f2937;
}

.cod-input:focus,
.cod-select:focus,
.cod-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.cod-input:disabled,
.cod-select:disabled,
.cod-textarea:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.cod-textarea {
    resize: vertical;
    min-height: 80px;
}

.cod-helper-text {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
}

/* Total Price */
.cod-total-price {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cod-total-label {
    font-size: 18px;
    font-weight: 600;
    color: #065f46;
}

.cod-total-amount {
    font-size: 28px;
    font-weight: 700;
    color: #16a34a;
}

/* Submit Button */
.cod-submit-button {
    width: 100%;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cod-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.cod-submit-button:active {
    transform: translateY(0);
}

.cod-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cod-button-icon {
    font-size: 24px;
}

/* Security Notice */
.cod-security-notice {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cod-lock-icon {
    font-size: 16px;
}

/* Benefits */
.cod-benefits {
    margin-top: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.cod-benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 15px;
    color: #374151;
}

.cod-check-icon {
    font-size: 20px;
    color: #16a34a;
}

/* Loading Overlay */
.cod-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.cod-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.cod-loading-overlay p {
    margin-top: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

/* Success Message */
.cod-success-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 11;
    padding: 40px;
    text-align: center;
}

.cod-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff;
    font-size: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.cod-success-message h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.cod-success-message p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Error Message */
.cod-error-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 11;
    padding: 40px;
    text-align: center;
}

.cod-error-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    font-size: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.cod-error-message h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.cod-error-text {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.cod-retry-button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cod-retry-button:hover {
    background: #1d4ed8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cod-order-form-wrapper {
        margin: 20px 10px;
    }
    
    .cod-form-container {
        padding: 20px;
    }
    
    .cod-form-title {
        font-size: 24px;
    }
    
    .cod-trust-badges {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cod-badge {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .cod-total-price {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Validation States */
.cod-input.error,
.cod-select.error,
.cod-textarea.error {
    border-color: #dc2626;
}

.cod-input.success,
.cod-select.success,
.cod-textarea.success {
    border-color: #16a34a;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.slide-up {
    animation: slideUp 0.3s ease;
}

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


/* ============================================
   UPSELL POPUP STYLES
   ============================================ */

/* Modal Overlay */
.cod-upsell-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: codUpsellFadeIn 0.3s ease-out;
}

.cod-upsell-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    animation: codUpsellOverlayFadeIn 0.3s ease-out;
}

/* Modal Content */
.cod-upsell-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    max-width: 540px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: codUpsellSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

/* Close Button */
.cod-upsell-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
    z-index: 10;
}

.cod-upsell-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #334155;
    transform: rotate(90deg);
}

/* Countdown Badge */
.cod-upsell-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: codUpsellPulse 2s infinite;
    z-index: 10;
}

/* Popup Body */
.cod-upsell-body {
    padding: 60px 40px 40px;
    text-align: center;
}

/* Icon */
.cod-upsell-icon {
    margin-bottom: 24px;
}

.cod-upsell-emoji {
    font-size: 72px;
    display: inline-block;
    animation: codUpsellBounce 1s ease-in-out infinite;
}

/* Headline */
.cod-upsell-headline {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.cod-upsell-countdown-header {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #dc2626;
    margin-top: 8px;
    animation: codUpsellPulse 2s infinite;
}

/* Subheadline */
.cod-upsell-subheadline {
    font-size: 18px;
    color: #475569;
    margin: 0 0 32px 0;
    line-height: 1.6;
}

/* Features */
.cod-upsell-features {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cod-upsell-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 16px;
    color: #334155;
    font-weight: 500;
}

.cod-upsell-feature:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

.cod-upsell-check {
    color: #10b981;
    flex-shrink: 0;
}

/* CTA Button */
.cod-upsell-button {
    width: 100%;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
    position: relative;
    overflow: hidden;
}

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

.cod-upsell-button:hover::before {
    left: 100%;
}

.cod-upsell-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

.cod-upsell-button:active {
    transform: translateY(0);
}

.cod-upsell-button-text {
    flex: 1;
}

.cod-upsell-countdown-button {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

.cod-upsell-arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.cod-upsell-button:hover .cod-upsell-arrow {
    transform: translateX(4px);
}

/* Skip Link */
.cod-upsell-skip {
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    margin-top: 16px;
    padding: 8px;
    transition: color 0.2s ease;
}

.cod-upsell-skip:hover {
    color: #334155;
    text-decoration: underline;
}

/* Animations */
@keyframes codUpsellFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes codUpsellSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes codUpsellBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* Responsive */
@media (max-width: 640px) {
    .cod-upsell-content {
        border-radius: 20px;
        max-width: 100%;
    }
    
    .cod-upsell-body {
        padding: 50px 24px 32px;
    }
    
    .cod-upsell-emoji {
        font-size: 56px;
    }
    
    .cod-upsell-headline {
        font-size: 24px;
    }
    
    .cod-upsell-subheadline {
        font-size: 16px;
    }
    
    .cod-upsell-button {
        font-size: 16px;
        padding: 16px 24px;
    }
    
    .cod-upsell-badge {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Hide countdown elements based on position setting */
.cod-upsell-modal[data-countdown-position="header"] .cod-upsell-countdown-button,
.cod-upsell-modal[data-countdown-position="header"] .cod-upsell-badge {
    display: none;
}

.cod-upsell-modal[data-countdown-position="button"] .cod-upsell-countdown-header,
.cod-upsell-modal[data-countdown-position="button"] .cod-upsell-badge {
    display: none;
}

.cod-upsell-modal[data-countdown-position="badge"] .cod-upsell-countdown-header,
.cod-upsell-modal[data-countdown-position="badge"] .cod-upsell-countdown-button {
    display: none;
}

.cod-upsell-modal[data-countdown-position="both"] .cod-upsell-badge {
    display: none;
}
