/**
 * uVitale Timewise Integration Styles
 * Path: assets/css/uvitale-timewise.css
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.uvitale-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   Payment Gateway Styles
   ========================================================================== */

.payment_method_coverwell_credits .payment_box {
    background: linear-gradient(135deg, #f8fff9 0%, #ecfdf5 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 25px;
    margin: 15px 0;
    position: relative;
}

.payment_method_coverwell_credits .payment_box::before {
    content: "🛡️";
    position: absolute;
    top: -10px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 16px;
}

.coverwell-benefits {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.coverwell-benefits h4 {
    color: #166534;
    margin: 0 0 15px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coverwell-benefits h4::before {
    content: "✨";
    font-size: 20px;
}

.benefits-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.benefits-list p {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #166534;
    font-weight: 500;
}

.benefits-list p::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
}

/* ==========================================================================
   Checkout Form Styles
   ========================================================================== */

#coverwell-payment-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#coverwell-terms {
    margin-right: 10px;
    transform: scale(1.2);
}

.coverwell-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin: 15px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coverwell-terms-label:hover {
    background: #f0f8ff;
    border-color: #2563eb;
}

.coverwell-terms-label input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

#coverwell-checkout-container {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    min-height: 500px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

#coverwell-checkout-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

/* ==========================================================================
   Checkout Status and Loading States
   ========================================================================== */

.coverwell-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    margin: 20px 0;
}

.coverwell-loading h3 {
    color: #1e293b;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.coverwell-loading p {
    color: #64748b;
    margin: 0 0 30px 0;
    font-size: 16px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.coverwell-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
}

.coverwell-success h2 {
    color: #065f46;
    margin: 0 0 15px 0;
    font-size: 28px;
}

.coverwell-success p {
    color: #047857;
    font-size: 16px;
    margin: 0 0 20px 0;
}

.coverwell-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
}

.coverwell-error h3 {
    color: #991b1b;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.coverwell-error p {
    color: #dc2626;
    font-size: 16px;
    margin: 0 0 20px 0;
}

/* ==========================================================================
   Cart Sync Styles
   ========================================================================== */

.uvitale-cart-sync {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.sync-status {
    margin-bottom: 20px;
}

.sync-status h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 18px;
}

#sync-status-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-weight: 600;
}

.status-indicator {
    font-size: 24px;
    transition: all 0.3s ease;
}

.status-indicator.status-synced {
    color: #10b981;
    animation: none;
}

.status-indicator.status-error {
    color: #ef4444;
    animation: none;
}

.status-indicator.status-syncing {
    color: #f59e0b;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.sync-details {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.sync-details p {
    margin: 8px 0;
    color: #374151;
    font-size: 14px;
}

.sync-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* ==========================================================================
   Product Eligibility Styles
   ========================================================================== */

.uvitale-product-eligibility {
    margin: 20px 0;
}

.eligibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    position: relative;
}

.eligibility-badge.eligible {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border: 2px solid #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.eligibility-badge.eligible::after {
    content: "PREMIUM";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #10b981;
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.eligibility-badge.not-eligible {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #cbd5e1;
}

.badge-icon {
    font-size: 18px;
}

.eligibility-details {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.eligibility-details h4 {
    color: #10b981;
    margin: 0 0 15px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.eligibility-details h4::before {
    content: "🛡️";
    font-size: 20px;
}

.eligibility-details ul {
    margin: 15px 0;
    padding-left: 0;
    list-style: none;
}

.eligibility-details li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
    color: #374151;
    font-size: 15px;
}

.eligibility-details li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
}

.eligibility-details .note {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    font-size: 13px;
    color: #166534;
    font-style: italic;
}

/* ==========================================================================
   Payment Options Comparison
   ========================================================================== */

.uvitale-payment-options {
    margin: 25px 0;
}

.payment-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.payment-comparison-table th {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 18px 15px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.payment-comparison-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.payment-comparison-table tr:nth-child(even) {
    background: #f8fafc;
}

.payment-comparison-table tr:hover {
    background: #f1f5f9;
}

.feature-yes {
    color: #10b981;
    font-weight: 700;
    font-size: 16px;
}

.feature-no {
    color: #ef4444;
    font-weight: 600;
}

.feature-partial {
    color: #f59e0b;
    font-weight: 600;
}

.payment-options-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 25px 0;
}

.payment-option {
    background: white;
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.payment-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.15);
}

.coverwell-option {
    border-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.coverwell-option:hover {
    border-color: #059669;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.traditional-option {
    border-color: #9ca3af;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.payment-option h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: bold;
}

.payment-option ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.payment-option li {
    padding: 8px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.payment-option li:last-child {
    border-bottom: none;
}

.recommended-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   Order Status Styles
   ========================================================================== */

.uvitale-order-status {
    max-width: 900px;
    margin: 25px 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.uvitale-order-status h3 {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    margin: 0;
    padding: 25px 30px;
    font-size: 24px;
    font-weight: 600;
}

.order-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.order-info,
.insurance-info {
    padding: 30px;
}

.order-info {
    border-right: 1px solid #e5e7eb;
}

.insurance-info {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-left: 4px solid #10b981;
}

.order-info p,
.insurance-info p {
    margin: 12px 0;
    color: #374151;
    font-size: 15px;
}

.order-info strong,
.insurance-info strong {
    color: #1f2937;
    font-weight: 600;
}

.coverwell-payment {
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
}

.insurance-info h4 {
    color: #065f46;
    margin: 0 0 20px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.coverage-details {
    background: white;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
}

.status-active {
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
}

.insurance-benefits h5 {
    color: #047857;
    margin: 20px 0 10px 0;
    font-size: 16px;
}

.insurance-benefits ul {
    margin: 10px 0;
    padding-left: 0;
    list-style: none;
}

.insurance-benefits li {
    margin: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #065f46;
    font-size: 14px;
}

.insurance-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.order-items {
    padding: 30px;
    border-top: 1px solid #e5e7eb;
}

.order-items h4 {
    color: #1f2937;
    margin: 0 0 20px 0;
    font-size: 18px;
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
}

.order-items-table th {
    background: #1f2937;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.order-items-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.order-items-table tr:nth-child(even) {
    background: white;
}

.coverage-yes {
    color: #10b981;
    font-weight: bold;
    font-size: 14px;
}

.coverage-no {
    color: #9ca3af;
    font-size: 14px;
}

/* ==========================================================================
   Checkout Status Banner
   ========================================================================== */

.uvitale-checkout-status {
    margin: 25px 0;
}

.checkout-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.checkout-banner::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    z-index: 1;
}

.banner-icon {
    font-size: 60px;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

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

.banner-text {
    flex-grow: 1;
}

.banner-text h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-text p {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
    line-height: 1.5;
}

.banner-cta .highlight {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.benefit-item {
    background: white;
    border: 2px solid #f3f4f6;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.benefit-item:hover {
    border-color: #10b981;
    transform: translateY(-4px);
    box-shadow: 0 12px 25px -5px rgba(16, 185, 129, 0.2);
}

.benefit-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.benefit-item:hover::before {
    transform: scaleX(1);
}

.benefit-icon {
    font-size: 36px;
    margin-bottom: 15px;
    color: #10b981;
    display: block;
}

.benefit-item h4 {
    margin: 15px 0 10px 0;
    font-size: 18px;
    color: #1f2937;
    font-weight: 600;
}

.benefit-item p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */

.uvitale-admin {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.uvitale-status-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.uvitale-status-card h2 {
    margin: 0 0 20px 0;
    color: #1f2937;
    font-size: 22px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

.uvitale-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 20px 0;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator.connected {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border: 2px solid #10b981;
}

.status-indicator.disconnected {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 2px solid #ef4444;
}

.status-indicator.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 2px solid #f59e0b;
}

.uvitale-metric {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.uvitale-metric .metric-value {
    font-size: 3em;
    font-weight: bold;
    color: #2563eb;
    display: block;
    line-height: 1;
    margin-bottom: 8px;
}

.uvitale-metric .metric-label {
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.uvitale-button-group {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.uvitale-log-viewer {
    background: #1f2937;
    color: #f9fafb;
    padding: 25px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    margin: 20px 0;
    border: 1px solid #374151;
}

.uvitale-log-viewer::-webkit-scrollbar {
    width: 8px;
}

.uvitale-log-viewer::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

.uvitale-log-viewer::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

.uvitale-log-viewer::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .uvitale-status-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .payment-options-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .order-summary {
        grid-template-columns: 1fr;
    }
    
    .order-info {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
}

@media (max-width: 768px) {
    .uvitale-container {
        padding: 15px;
    }
    
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .banner-icon {
        font-size: 48px;
    }
    
    .banner-text h3 {
        font-size: 24px;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .uvitale-button-group {
        flex-direction: column;
    }
    
    .uvitale-button-group .button {
        width: 100%;
        text-align: center;
    }
    
    .payment-comparison-table {
        font-size: 14px;
    }
    
    .payment-comparison-table th,
    .payment-comparison-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    #coverwell-payment-form {
        padding: 20px;
    }
    
    .coverwell-benefits {
        padding: 15px;
    }
    
    .eligibility-badge {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .uvitale-status-card {
        padding: 20px;
    }
    
    .benefit-item {
        padding: 20px;
    }
    
    .benefit-icon {
        font-size: 28px;
    }
    
    .order-items-table th,
    .order-items-table td {
        padding: 10px;
        font-size: 14px;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.uvitale-hidden {
    display: none !important;
}

.uvitale-text-center {
    text-align: center;
}

.uvitale-text-left {
    text-align: left;
}

.uvitale-text-right {
    text-align: right;
}

.uvitale-mb-0 { margin-bottom: 0 !important; }
.uvitale-mb-10 { margin-bottom: 10px !important; }
.uvitale-mb-20 { margin-bottom: 20px !important; }
.uvitale-mb-30 { margin-bottom: 30px !important; }

.uvitale-mt-0 { margin-top: 0 !important; }
.uvitale-mt-10 { margin-top: 10px !important; }
.uvitale-mt-20 { margin-top: 20px !important; }
.uvitale-mt-30 { margin-top: 30px !important; }

.uvitale-p-0 { padding: 0 !important; }
.uvitale-p-10 { padding: 10px !important; }
.uvitale-p-20 { padding: 20px !important; }
.uvitale-p-30 { padding: 30px !important; }

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .uvitale-status-card {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .uvitale-status-card h2 {
        color: #f9fafb;
        border-bottom-color: #374151;
    }
    
    .uvitale-metric {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .benefit-item {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .benefit-item h4 {
        color: #f9fafb;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .uvitale-button-group,
    .sync-controls,
    .banner-cta,
    .coverwell-loading,
    .loading-spinner {
        display: none !important;
    }
    
    .uvitale-status-card,
    .benefit-item,
    .order-summary {
        break-inside: avoid;
    }
    
    .checkout-banner {
        background: #f3f4f6 !important;
        color: #1f2937 !important;
    }
}