/* WooCommerce Deposit System - Frontend Styles */
/* Version: 2.0.0 */


/* Hide default WooCommerce form elements that might be conflicting 
.woocommerce-checkout .woocommerce-checkout-review-order {
    clear: both !important;
}*/
/* Product Page Styles */
.wc-deposit-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.wc-deposit-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 10px 10px;
    opacity: 0.3;
}

.deposit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.deposit-title {
    color: white;
    margin: 0;
    font-size: 1.4em;
    font-weight: 700;
}

.deposit-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.deposit-breakdown {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.breakdown-item.highlight {
    background: rgba(255,255,255,0.15);
    margin: 0 -20px;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 700;
}

.breakdown-item .label {
    font-weight: 500;
}

.breakdown-item .amount {
    font-weight: 700;
    font-size: 1.1em;
}

.deposit-features {
    display: grid;
    gap: 12px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-icon {
    background: rgba(255,255,255,0.2);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

.feature-text {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Checkout Page Styles */
.wc-deposit-checkout-options {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    border: 1px solid #e0e6ed;
    position: relative;
}

.deposit-options-header {
    text-align: center;
    margin-bottom: 30px;
}

.deposit-options-header h3 {
    color: #2d3748;
    margin: 0 0 8px 0;
    font-size: 1.5em;
}

.deposit-options-header p {
    color: #718096;
    margin: 0;
    font-size: 0.95em;
}

.payment-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.payment-option {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: white;
}

.payment-option:hover {
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.payment-option.active {
    border-color: #4299e1;
    background: linear-gradient(135deg, #ebf4ff 0%, #e6fffa 100%);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.15);
    transform: translateY(-2px);
}

.option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.option-header input[type="radio"] {
    margin: 0;
    transform: scale(1.2);
}

.option-title {
    font-weight: 700;
    font-size: 1.1em;
    color: #2d3748;
    margin: 0;
}

.option-amount {
    font-size: 1.8em;
    font-weight: 800;
    color: #2d3748;
    margin: 15px 0;
    text-align: center;
}

.option-amount.highlight {
    color: #4299e1;
}

.option-breakdown {
    background: rgba(255,255,255,0.7);
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.9em;
}

.breakdown-row.cod-notice {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #dee2e6;
}

.breakdown-row.cod-notice small {
    color: #28a745;
    font-weight: 500;
}

.option-description {
    text-align: center;
    color: #718096;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Security Notice */
.deposit-security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding: 12px;
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 5px;
    font-size: 0.9em;
}

.security-icon {
    font-size: 1.2em;
}

.security-text {
    color: #2e7d32;
    font-weight: 500;
}

/* Balance Payment Portal */
.deposit-balance-portal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    border: 1px solid #e0e6ed;
}

.balance-portal-header {
    text-align: center;
    margin-bottom: 30px;
}

.balance-amount {
    font-size: 2.5em;
    font-weight: 800;
    color: #dc3545;
    margin: 15px 0;
    text-align: center;
}

.balance-due-date {
    text-align: center;
    color: #718096;
    margin-bottom: 20px;
}

.balance-payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.balance-payment-method {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.balance-payment-method:hover {
    border-color: #4299e1;
    transform: translateY(-2px);
}

.balance-payment-method.active {
    border-color: #4299e1;
    background: #ebf4ff;
}

/* Payment Plans */
.payment-plans-container {
    margin: 20px 0;
}

.payment-plan-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.payment-plan-option {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.payment-plan-option:hover {
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.payment-plan-option.active {
    border-color: #4299e1;
    background: #ebf4ff;
    box-shadow: 0 5px 15px rgba(66, 153, 225, 0.1);
}

.payment-plan-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 15px;
}

.payment-plan-name {
    font-weight: 700;
    font-size: 1.2em;
    color: #2d3748;
    margin: 0;
}

.payment-plan-badge {
    background: #4299e1;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.payment-plan-schedule {
    margin: 15px 0;
}

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

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

.payment-schedule-item.highlight {
    background: #f8fafc;
    margin: 0 -20px;
    padding: 8px 20px;
    border-radius: 4px;
}

/* Customer Order History */
.woocommerce-order-deposit-details {
    margin: 2em 0;
    padding: 1.5em;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #007cba;
}

.woocommerce-order-deposit-details h3 {
    margin-top: 0;
    color: #2d3748;
}

.deposit-badge, .balance-badge {
    display: inline-block;
    margin: 2px 0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
}

.deposit-badge {
    background: #ffc107;
    color: #000;
}

.balance-badge {
    background: #dc3545;
    color: #fff;
}

/* Loading States */
.payment-option.loading {
    opacity: 0.7;
    pointer-events: none;
}

.payment-option.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.payment-option.error {
    border-color: #dc3545;
    background: #f8d7da;
}

.deposit-error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
    display: none;
}

/* Success States */
.payment-option.success {
    border-color: #28a745;
    background: #d4edda;
}

/* Progress Bars */
.deposit-progress {
    margin: 15px 0;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4299e1, #667eea);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8em;
    color: #718096;
}

/* Responsive Design */
@media (max-width: 768px) {
    .payment-options-grid {
        grid-template-columns: 1fr;
    }
    
    .wc-deposit-section {
        padding: 20px;
        margin: 20px 0;
    }
    
    .deposit-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .payment-plan-options {
        grid-template-columns: 1fr;
    }
    
    .balance-payment-methods {
        grid-template-columns: 1fr;
    }
    
    .option-amount {
        font-size: 1.5em;
    }
    
    .balance-amount {
        font-size: 2em;
    }
}

/* Print Styles */
@media print {
    .wc-deposit-section {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
    }
    
    .deposit-breakdown {
        background: #f8f9fa !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wc-deposit-section {
        border: 2px solid currentColor;
    }
    
    .payment-option.active {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .payment-option,
    .balance-payment-method,
    .payment-plan-option {
        transition: none;
    }
    
    .payment-option:hover,
    .balance-payment-method:hover,
    .payment-plan-option:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wc-deposit-checkout-options,
    .deposit-balance-portal {
        background: #1a202c;
        border-color: #2d3748;
        color: #e2e8f0;
    }
    
    .deposit-options-header h3 {
        color: #e2e8f0;
    }
    
    .deposit-options-header p {
        color: #a0aec0;
    }
    
    .payment-option {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .option-title {
        color: #e2e8f0;
    }
    
    .option-amount {
        color: #e2e8f0;
    }
    
    .option-breakdown {
        background: #4a5568;
    }
}
/* Deposit fee display in checkout */
.woocommerce-checkout-review-order-table .future-balance-fee {
    color: #dc3545;
    font-style: italic;
}

.woocommerce-checkout-review-order-table .future-balance-fee .amount {
    color: #dc3545;
    font-weight: bold;
}

/* Highlight deposit total */
.woocommerce-checkout-review-order-table .order-total.deposit-selected .amount {
    color: #28a745;
    font-weight: bold;
}

/* Deposit notice */
.deposit-checkout-notice {
    background: #e7f3ff;
    border: 1px solid #007cba;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

.deposit-checkout-notice h4 {
    margin-top: 0;
    color: #007cba;
}

.deposit-checkout-notice ul {
    margin: 10px 0;
    padding-left: 20px;
}

.deposit-checkout-notice li {
    margin-bottom: 5px;
}