/* 
 * Stripe Integration Styles for Site 3 (ipurifyair.com)
 * Updated for 3-site payment gateway compatibility
 * Includes admin interface and legacy button styles
 */

/* Legacy Stripe Button Styles (for backward compatibility) */
.custom-stripe-button {
    background: linear-gradient(135deg, #635bff 0%, #5a54d9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(99, 91, 255, 0.2);
}

.custom-stripe-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;
}

.custom-stripe-button:hover {
    background: linear-gradient(135deg, #5a54d9 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 91, 255, 0.3);
}

.custom-stripe-button:hover::before {
    left: 100%;
}

.custom-stripe-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(99, 91, 255, 0.2);
}

.custom-stripe-button:disabled {
    background: #b8b5ff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.custom-stripe-button:disabled::before {
    display: none;
}

.custom-stripe-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.3);
}

/* Legacy button warning overlay */
.custom-stripe-button.legacy-warning {
    position: relative;
}

.custom-stripe-button.legacy-warning::after {
    content: '⚠ Direct Payment';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 400;
}

/* Admin Interface Styles */
.stripe-admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.stripe-settings-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.stripe-settings-main {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stripe-settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stripe-status-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stripe-status-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 500;
    color: #555;
}

.status-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.status-value.success {
    color: #00a32a;
}

.status-value.error {
    color: #dc3232;
}

.status-value.warning {
    color: #ffb900;
}

.status-value.info {
    color: #0073aa;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Form Input Styling */
.stripe-form-field {
    margin-bottom: 20px;
}

.stripe-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.stripe-form-field input[type="text"],
.stripe-form-field input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.stripe-form-field input:focus {
    outline: none;
    border-color: #635bff;
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

.stripe-form-field input.error {
    border-color: #dc3232;
}

.stripe-form-field input.success {
    border-color: #00a32a;
}

.stripe-form-field .field-description {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
}

.stripe-form-field .field-error {
    font-size: 13px;
    color: #dc3232;
    margin-top: 4px;
}

.stripe-form-field .field-success {
    font-size: 13px;
    color: #00a32a;
    margin-top: 4px;
}

/* Button Styles */
.stripe-button {
    background: #635bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.stripe-button:hover {
    background: #5a54d9;
    transform: translateY(-1px);
}

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

.stripe-button:disabled {
    background: #b8b5ff;
    cursor: not-allowed;
    transform: none;
}

.stripe-button.secondary {
    background: #f6f8fa;
    color: #24292e;
    border: 1px solid #d0d7de;
}

.stripe-button.secondary:hover {
    background: #f3f4f6;
    border-color: #afb8c1;
}

.stripe-button.danger {
    background: #dc3232;
}

.stripe-button.danger:hover {
    background: #b32d2e;
}

.stripe-button.small {
    padding: 6px 12px;
    font-size: 12px;
}

.stripe-button.large {
    padding: 14px 28px;
    font-size: 16px;
}

/* Test Mode Indicator */
.test-mode-indicator {
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    animation: pulse-glow 2s infinite;
}

.test-mode-indicator::before {
    content: '🧪';
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 107, 107, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.6); }
}

/* Live Mode Indicator */
.live-mode-indicator {
    background: linear-gradient(135deg, #00a32a, #46a049);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

.live-mode-indicator::before {
    content: '🚀';
}

/* Webhook Testing Panel */
.webhook-testing-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.webhook-testing-panel h3 {
    margin: 0 0 16px 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.webhook-testing-panel h3::before {
    content: '🔧';
}

.webhook-test-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.webhook-test-results {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.webhook-test-results pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.webhook-test-results.success {
    border-color: #00a32a;
    background: #f7fff7;
}

.webhook-test-results.error {
    border-color: #dc3232;
    background: #fff7f7;
}

/* Connection Status Indicators */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.connection-status.connected {
    background: #e8f5e8;
    color: #2e7d2e;
}

.connection-status.disconnected {
    background: #ffeaea;
    color: #c62828;
}

.connection-status.testing {
    background: #fff3cd;
    color: #856404;
}

/* Progress Indicators */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #635bff, #5a54d9);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-bar-fill.animated {
    animation: progress-slide 1.5s ease-in-out infinite;
}

@keyframes progress-slide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #635bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

/* Tooltip Styles */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stripe-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .webhook-test-buttons {
        flex-direction: column;
    }
    
    .stripe-button {
        width: 100%;
        justify-content: center;
    }
    
    .custom-stripe-button {
        width: 100%;
        text-align: center;
    }
    
    .test-mode-indicator,
    .live-mode-indicator {
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .stripe-button,
    .custom-stripe-button,
    .webhook-testing-panel {
        display: none;
    }
    
    .stripe-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .stripe-status-card {
        break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .custom-stripe-button {
        border: 2px solid #000;
    }
    
    .stripe-form-field input {
        border-width: 2px;
    }
    
    .status-dot {
        border: 1px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .custom-stripe-button,
    .stripe-button,
    .loading-spinner,
    .progress-bar-fill {
        animation: none;
        transition: none;
    }
    
    .custom-stripe-button:hover,
    .stripe-button:hover {
        transform: none;
    }
}