/**
 * BaaShops Booking Fee - Frontend Styles
 * Responsive styles for payment modal and invoice display
 */

/* Modal Overlay */
.baashops-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content */
.baashops-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-in-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.baashops-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.baashops-modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.baashops-modal-description {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.5;
}

/* Modal Body */
.baashops-modal-body {
    padding: 30px;
}

/* Invoice Box */
.baashops-invoice-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.baashops-invoice-box h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.baashops-invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.baashops-invoice-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.baashops-invoice-table tr:last-child {
    border-bottom: none;
}

.baashops-invoice-table td {
    padding: 12px 8px;
    font-size: 15px;
    line-height: 1.5;
}

.baashops-invoice-table td:first-child {
    color: #666;
    width: 60%;
}

.baashops-invoice-table td:last-child {
    text-align: right;
    font-weight: 500;
}

.baashops-amount {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.baashops-booking-fee-row td {
    background: #fff3cd;
}

.baashops-booking-fee-row .baashops-amount {
    color: #856404;
}

.baashops-balance-row {
    border-top: 2px solid #0073aa !important;
    font-weight: 600;
}

.baashops-balance-row td {
    padding-top: 15px;
    font-size: 17px;
}

.baashops-balance-row .baashops-amount {
    color: #0073aa;
    font-size: 18px;
}

.baashops-highlight {
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
}

.baashops-invoice-note {
    margin: 15px 0 0;
    padding: 12px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    border-radius: 4px;
}

.baashops-invoice-note strong {
    color: #0073aa;
}

/* Terms & Conditions Box */
.baashops-terms-box {
    margin-bottom: 25px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 6px;
}

.baashops-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.6;
}

.baashops-checkbox-label input[type="checkbox"] {
    margin: 3px 10px 0 0;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.baashops-checkbox-label a {
    color: #0073aa;
    text-decoration: underline;
}

.baashops-checkbox-label a:hover {
    color: #005a87;
}

/* Stripe Payment Element */
#baashops-payment-element {
    margin-bottom: 20px;
}

/* Messages */
.baashops-message {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.baashops-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.baashops-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.baashops-error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 5px;
}

/* Modal Footer */
.baashops-modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

.baashops-button-primary {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
    width: 100%;
    max-width: 300px;
}

.baashops-button-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    box-shadow: 0 6px 16px rgba(0, 115, 170, 0.4);
    transform: translateY(-2px);
}

.baashops-button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Banner */
.baashops-success-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #4caf50;
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    z-index: 1000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .baashops-modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: 95vh;
    }

    .baashops-modal-header {
        padding: 20px 20px 15px;
    }

    .baashops-modal-header h2 {
        font-size: 20px;
    }

    .baashops-modal-description {
        font-size: 13px;
    }

    .baashops-modal-body {
        padding: 20px;
    }

    .baashops-invoice-box {
        padding: 15px;
    }

    .baashops-invoice-box h3 {
        font-size: 16px;
    }

    .baashops-invoice-table td {
        padding: 10px 5px;
        font-size: 14px;
    }

    .baashops-invoice-table td:first-child {
        width: 55%;
    }

    .baashops-amount {
        font-size: 15px;
    }

    .baashops-balance-row .baashops-amount {
        font-size: 16px;
    }

    .baashops-invoice-note {
        font-size: 12px;
        padding: 10px;
    }

    .baashops-terms-box {
        padding: 12px;
    }

    .baashops-checkbox-label {
        font-size: 13px;
    }

    .baashops-checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .baashops-modal-footer {
        padding: 15px 20px 20px;
    }

    .baashops-button-primary {
        padding: 14px 30px;
        font-size: 15px;
        max-width: 100%;
    }

    .baashops-success-banner {
        padding: 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .baashops-modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .baashops-modal-header {
        border-radius: 0;
    }

    .baashops-invoice-table td {
        padding: 8px 3px;
        font-size: 13px;
    }

    .baashops-invoice-table td:first-child {
        width: 50%;
    }
}

/* Loading State */
.baashops-button-primary.loading {
    position: relative;
    color: transparent;
}

.baashops-button-primary.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {
    .baashops-modal {
        display: none !important;
    }
}
