/**
 * Gift Card Purchase Page Styles
 * Matches the Make a Payment page design
 * 
 * @package Celtic_Horizon_Tours
 */

/* Base Styles */
* {
    box-sizing: border-box;
}

.cht-gift-card-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
}

/* Header */
.cht-portal-header {
    text-align: center;
    margin-bottom: 40px;
}

.cht-portal-header h2 {
    margin: 0 0 10px 0;
    font-size: 36px;
    font-weight: 700;
    color: #1f2937;
}

.cht-portal-header p {
    margin: 0;
    font-size: 16px;
    color: #6b7280;
}

/* Step Sections */
.cht-step-section {
    position: relative;
    margin-bottom: 30px;
}

.cht-step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1070FF 0%, #0D5CE6 100%);
    color: #ffffff;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(16, 112, 255, 0.3);
}

.cht-section-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cht-section-card h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #1f2937;
    font-weight: 700;
}

.cht-section-card > p {
    margin: 0 0 25px 0;
    color: #6b7280;
    font-size: 14px;
}

/* Amount Selection */
.cht-amount-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.cht-amount-btn {
    background: #ffffff;
    border: 3px solid #e5e7eb;
    border-radius: 10px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: inherit;
}

.cht-amount-btn:hover {
    border-color: #1070FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 112, 255, 0.2);
}

.cht-amount-btn.selected {
    background: linear-gradient(135deg, #1070FF 0%, #0D5CE6 100%);
    border-color: #1070FF;
    box-shadow: 0 6px 16px rgba(16, 112, 255, 0.3);
}

.cht-amount-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.cht-amount-btn.selected .cht-amount-value {
    color: #ffffff;
}

/* Custom Amount */
.cht-custom-amount-section {
    margin: 30px 0;
    padding: 25px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.cht-input-wrapper {
    position: relative;
    margin-top: 10px;
}

.cht-currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
}

.cht-amount-input {
    padding-left: 40px !important;
    font-size: 18px !important;
    font-weight: 600;
}

/* Form Elements */
.cht-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.cht-form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.cht-form-input:focus {
    outline: none;
    border-color: #1070FF;
    box-shadow: 0 0 0 3px rgba(16, 112, 255, 0.1);
}

.cht-textarea {
    min-height: 100px;
    resize: vertical;
}

.cht-field-note {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #9ca3af;
}

.cht-char-count {
    text-align: right;
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #9ca3af;
}

/* Form Sections */
.cht-form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.cht-form-section:last-child {
    border-bottom: none;
}

.cht-form-section-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.cht-form-group {
    margin-bottom: 20px;
}

.cht-form-row {
    display: grid;
    gap: 15px;
}

.cht-form-row-2col {
    grid-template-columns: 1fr 1fr;
}

.cht-form-row-3col {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .cht-form-row-2col,
    .cht-form-row-3col {
        grid-template-columns: 1fr;
    }
}

/* Payment Summary */
.cht-payment-summary-box {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.cht-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cht-summary-row:last-child {
    border-bottom: none;
}

.cht-summary-total {
    border-top: 2px solid #1070FF;
    margin-top: 10px;
    padding-top: 15px !important;
    font-size: 18px;
}

.cht-summary-total strong {
    color: #1070FF;
    font-size: 24px;
}

.cht-protection-note {
    margin-top: 15px;
    padding: 12px;
    background: #fff3cd;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
}

.cht-protection-note p {
    margin: 0;
    font-size: 12px;
    color: #78350f;
    line-height: 1.5;
}

/* Card Payment Section */
.cht-card-payment-section {
    margin: 30px 0;
}

#st-form {
    margin-top: 15px;
}

/* Terms Section */
.cht-terms-section {
    margin: 25px 0;
    padding: 20px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
}

.cht-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.cht-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cht-checkbox-label a {
    color: #1070FF;
    text-decoration: underline;
}

/* Buttons */
.cht-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.cht-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cht-btn-primary {
    background: linear-gradient(135deg, #1070FF 0%, #0D5CE6 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 112, 255, 0.3);
}

.cht-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 112, 255, 0.4);
}

.cht-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.cht-btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.cht-btn-large {
    padding: 14px 32px;
    font-size: 17px;
}

/* Form Actions */
.cht-form-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .cht-form-actions {
        flex-direction: column-reverse;
    }
    
    .cht-form-actions .cht-btn {
        width: 100%;
    }
}

/* Security Badges */
.cht-security-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.cht-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
}

.cht-badge i {
    color: #10b981;
}

/* Processing Overlay */
.cht-processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cht-processing-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
}

.cht-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #1070FF;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cht-processing-content h3 {
    margin: 0 0 10px 0;
    color: #1f2937;
}

.cht-processing-content p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Success/Error Sections */
.cht-success-section,
.cht-error-section {
    text-align: center;
    padding: 60px 30px;
}

.cht-success-icon {
    font-size: 80px;
    color: #10b981;
    margin-bottom: 20px;
}

.cht-error-icon {
    font-size: 80px;
    color: #ef4444;
    margin-bottom: 20px;
}

.cht-success-section h2,
.cht-error-section h2 {
    margin: 0 0 15px 0;
    font-size: 32px;
    color: #1f2937;
}

.cht-success-section p,
.cht-error-section p {
    margin: 0 0 30px 0;
    color: #6b7280;
    font-size: 16px;
}

.cht-success-details {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 25px;
    margin: 30px auto;
    max-width: 500px;
}

.cht-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cht-detail-row:last-child {
    border-bottom: none;
}

.cht-success-note {
    color: #6b7280;
    font-size: 14px;
    margin: 20px 0 30px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .cht-gift-card-portal {
        padding: 15px;
    }
    
    .cht-portal-header h2 {
        font-size: 28px;
    }
    
    .cht-section-card {
        padding: 20px;
    }
    
    .cht-amount-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .cht-security-badges {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .cht-amount-grid {
        grid-template-columns: 1fr;
    }
}

/* Trust Payments Card Input Fields */
.cht-card-fields-wrapper {
    margin: 20px 0;
}

.cht-card-input-field {
    min-height: 48px;
    padding: 2px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #ffffff;
}

.cht-card-input-field iframe {
    width: 100%;
    height: 44px;
    border: none !important;
}

/* Focus state for card inputs */
.cht-card-input-field:focus-within {
    border-color: #1070FF;
    box-shadow: 0 0 0 3px rgba(16, 112, 255, 0.1);
}

/* Error state for card inputs */
.cht-card-input-field.error,
body.payment-attempted #st-card-number iframe.st-input--invalid,
body.payment-attempted #st-expiration-date iframe.st-input--invalid,
body.payment-attempted #st-security-code iframe.st-input--invalid {
    border-color: #ef4444 !important;
}

/* Card payment section specific styling */
.cht-card-payment-section {
    margin: 30px 0;
}

#st-form {
    margin-top: 10px;
}

