/**
 * Frontend CSS Styles
 * Styling for the Domain Bridge ZarinPal frontend interface
 * 
 * @package DomainBridgeZarinPal
 * @version 1.0.0
 */

/* ===========================================
   CHECKOUT GATEWAY STYLES
   =========================================== */

.payment_method_domain_bridge_zarinpal {
    position: relative;
}

.payment_method_domain_bridge_zarinpal .payment_box {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.payment_method_domain_bridge_zarinpal .payment_box p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
}

.payment_method_domain_bridge_zarinpal .payment_box p:last-child {
    margin-bottom: 0;
}

/* Gateway Icon */
.payment_method_domain_bridge_zarinpal label img {
    max-height: 24px;
    max-width: 100px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Security Badge */
.dbz-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e8;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    margin-top: 8px;
}

.dbz-security-badge::before {
    content: "🔒";
    font-size: 1em;
}

/* Payment Features */
.dbz-payment-features {
    margin-top: 12px;
}

.dbz-payment-features h4 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #333;
    font-weight: 600;
}

.dbz-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
}

.dbz-feature-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.85em;
}

.dbz-feature-list li::before {
    content: "✓";
    color: #2e7d32;
    font-weight: bold;
    font-size: 1em;
}

/* ===========================================
   LOADING STATES
   =========================================== */

.dbz-payment-loading {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 4px;
    color: #1565c0;
    font-size: 0.9em;
}

.dbz-payment-loading.active {
    display: flex;
}

.dbz-payment-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #e3f2fd;
    border-top: 2px solid #1565c0;
    border-radius: 50%;
    animation: dbz-spin 1s linear infinite;
}

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

/* ===========================================
   ORDER DETAILS ENHANCEMENTS
   =========================================== */

.dbz-order-payment-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.dbz-order-payment-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dbz-order-payment-info h3::before {
    content: "💳";
    font-size: 1.2em;
}

.dbz-payment-details {
    display: grid;
    gap: 8px;
}

.dbz-payment-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
}

.dbz-payment-detail:last-child {
    border-bottom: none;
}

.dbz-payment-detail .label {
    font-weight: 500;
    color: #666;
}

.dbz-payment-detail .value {
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
}

.dbz-ref-id {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dbz-ref-id:hover {
    background: #c8e6c9;
}

.dbz-ref-id.copied {
    background: #4caf50;
    color: white;
}

/* ===========================================
   THANK YOU PAGE ENHANCEMENTS
   =========================================== */

.woocommerce-thankyou-order-received {
    margin-bottom: 20px;
}

.dbz-thank-you-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.dbz-thank-you-section h3 {
    margin: 0 0 15px 0;
    color: #2e7d32;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dbz-thank-you-section h3::before {
    content: "✅";
    font-size: 1.5em;
}

.dbz-ref-id-display {
    background: white;
    border: 2px solid #2e7d32;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    display: inline-block;
}

.dbz-ref-id-display .label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.dbz-ref-id-display .ref-id {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: bold;
    color: #2e7d32;
    letter-spacing: 1px;
}

.dbz-copy-ref-id {
    margin-top: 10px;
    background: #2e7d32;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.dbz-copy-ref-id:hover {
    background: #1b5e20;
}

.dbz-copy-ref-id.copied {
    background: #4caf50;
}

/* ===========================================
   ERROR STATES
   =========================================== */

.dbz-payment-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    color: #c53030;
}

.dbz-payment-error h4 {
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c53030;
}

.dbz-payment-error h4::before {
    content: "⚠️";
    font-size: 1.2em;
}

.dbz-error-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dbz-retry-button {
    background: #3182ce;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.dbz-retry-button:hover {
    background: #2c5282;
    color: white;
    text-decoration: none;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

@media (max-width: 768px) {
    .payment_method_domain_bridge_zarinpal .payment_box {
        padding: 12px;
    }
    
    .dbz-feature-list {
        grid-template-columns: 1fr;
    }
    
    .dbz-payment-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .dbz-thank-you-section {
        padding: 15px;
    }
    
    .dbz-ref-id-display .ref-id {
        font-size: 1em;
        word-break: break-all;
    }
    
    .dbz-error-actions {
        flex-direction: column;
    }
    
    .dbz-retry-button {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .payment_method_domain_bridge_zarinpal label img {
        max-height: 20px;
        margin-left: 6px;
    }
    
    .dbz-thank-you-section h3 {
        font-size: 1.1em;
        flex-direction: column;
        gap: 5px;
    }
    
    .dbz-ref-id-display {
        padding: 12px;
        margin: 10px 0;
    }
    
    .dbz-copy-ref-id {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

/* ===========================================
   RTL SUPPORT
   =========================================== */

.rtl .payment_method_domain_bridge_zarinpal label img {
    margin-left: 0;
    margin-right: 8px;
}

.rtl .dbz-feature-list li {
    text-align: right;
}

.rtl .dbz-payment-detail {
    flex-direction: row-reverse;
}

.rtl .dbz-thank-you-section h3 {
    flex-direction: row-reverse;
}

/* ===========================================
   PRINT STYLES
   =========================================== */

@media print {
    .dbz-copy-ref-id,
    .dbz-retry-button {
        display: none;
    }
    
    .dbz-ref-id-display {
        border: 2px solid #000;
    }
    
    .dbz-thank-you-section {
        background: white;
        border: 1px solid #000;
    }
}

/* ===========================================
   ACCESSIBILITY ENHANCEMENTS
   =========================================== */

.dbz-copy-ref-id:focus,
.dbz-retry-button:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

.dbz-ref-id:focus {
    outline: 2px solid #2e7d32;
    outline-offset: 2px;
}

/* Screen reader only text */
.dbz-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}