/**
 * A2E Textbook Frontend Styles
 *
 * @package A2E_Textbook_Ordering
 */

/* Jimmy 31012026 00:40 - Frontend styles */
/* Jimmy 08022026 00:54 - Moved inline styles from login-form.php and registration-form.php */
/* Jimmy 12022026 17:43 - Add set product styles */
/* Jimmy 12022026 22:02 - Add payment slip upload styles */
/* Jimmy 12022026 22:29 - Add email verification notice styles */

/* Loading Spinner */
.a2e-loading {
    position: relative;
    pointer-events: none;
}

.a2e-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: a2e-spin 0.8s linear infinite;
}

@keyframes a2e-spin {
    to {
        transform: rotate(360deg);
    }
}

/* User Info Bar */
.a2e-user-info-bar {
    background: #f5f5f5;
    padding: 10px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.a2e-user-info-bar .user-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.a2e-user-info-bar .user-details span {
    color: #666;
}

.a2e-user-info-bar .user-details strong {
    color: #333;
}

.a2e-user-info-bar .user-actions a {
    color: #0073aa;
    text-decoration: none;
}

.a2e-user-info-bar .user-actions a:hover {
    text-decoration: underline;
}

/* Form Styles */
.a2e-form-errors {
    background: #fef7f7;
    border: 1px solid #dc3232;
    border-left-width: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.a2e-form-errors ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.a2e-form-errors li {
    color: #dc3232;
    margin: 5px 0;
}

.a2e-form-success {
    background: #f0f9f0;
    border: 1px solid #46b450;
    border-left-width: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #32a032;
}

/* Product Card Visibility Badge */
.a2e-product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
}

.a2e-product-badge.badge-inno {
    background: #e3f2fd;
    color: #1976d2;
}

.a2e-product-badge.badge-global {
    background: #fff3e0;
    color: #f57c00;
}

.a2e-product-badge.badge-eip {
    background: #e8f5e9;
    color: #388e3c;
}

.a2e-product-badge.badge-thai {
    background: #fce4ec;
    color: #c2185b;
}

/* ===== Login Form ===== */
.a2e-login-form-wrapper {
    max-width: 450px;
    margin: 40px auto;
}

.a2e-login-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.a2e-login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.a2e-login-form .form-row {
    margin-bottom: 20px;
}

.a2e-login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.a2e-login-form input[type="email"],
.a2e-login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.a2e-login-form button[type="submit"] {
    width: 100%;
    padding: 15px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.a2e-login-form button[type="submit"]:hover {
    background: #005a87;
}

.a2e-login-register-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.a2e-login-register-link a {
    color: #0073aa;
    font-weight: 600;
}

/* ===== Registration Form ===== */
.a2e-registration-form-wrapper {
    max-width: 550px;
    margin: 40px auto;
}

.a2e-registration-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.a2e-registration-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.a2e-invite-notice {
    margin-bottom: 20px;
    padding: 15px;
    background: #e7f7e7;
    border-left: 4px solid #46b450;
    border-radius: 4px;
}

.a2e-form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.a2e-form-section:last-of-type {
    border-bottom: none;
}

.a2e-form-section h3 {
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
}

.a2e-registration-form .form-row {
    margin-bottom: 15px;
}

.a2e-registration-form .form-row-first,
.a2e-registration-form .form-row-last {
    width: 48%;
    display: inline-block;
    vertical-align: top;
}

.a2e-registration-form .form-row-first {
    margin-right: 4%;
}

.a2e-registration-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.a2e-registration-form input[type="text"],
.a2e-registration-form input[type="email"],
.a2e-registration-form input[type="tel"],
.a2e-registration-form input[type="password"],
.a2e-registration-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.a2e-registration-form select:disabled {
    background: #f5f5f5;
}

.a2e-registration-form .description {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.a2e-registration-form .optional {
    font-weight: normal;
    color: #999;
}

.a2e-registration-form button[type="submit"] {
    width: 100%;
    padding: 15px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.a2e-registration-form button[type="submit"]:hover {
    background: #005a87;
}

.a2e-register-login-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.a2e-register-login-link a {
    color: #0073aa;
    font-weight: 600;
}

.clear {
    clear: both;
}

/* Responsive */
@media (max-width: 768px) {
    .a2e-user-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .a2e-user-info-bar .user-details {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .a2e-registration-form .form-row-first,
    .a2e-registration-form .form-row-last {
        width: 100%;
        margin-right: 0;
    }
}

/* ===== Set Product: Book List on Product Page ===== */
.a2e-set-book-list {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

.a2e-set-book-list h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #333;
}

.a2e-set-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.a2e-set-table thead th {
    background: #f8f9fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
    color: #555;
}

.a2e-set-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.a2e-set-table tbody tr:hover {
    background: #f8f9fa;
}

.a2e-set-table .a2e-col-num {
    width: 35px;
    text-align: center;
    color: #999;
}

.a2e-set-table .a2e-col-price {
    width: 80px;
    text-align: right;
    white-space: nowrap;
}

.a2e-set-table .a2e-publisher {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.a2e-set-table tfoot td {
    padding: 8px 12px;
    font-size: 13px;
}

.a2e-set-table tfoot .a2e-subtotal td {
    border-top: 2px solid #dee2e6;
    color: #555;
}

.a2e-set-table tfoot .a2e-fee td {
    color: #888;
    font-size: 12px;
}

.a2e-set-table tfoot .a2e-total td {
    border-top: 2px solid #333;
    font-size: 15px;
    color: #333;
}

/* ===== Set Product: Cart Details ===== */
.a2e-set-cart-details {
    margin-top: 5px;
    font-size: 13px;
}

.a2e-set-cart-details summary {
    cursor: pointer;
    color: #0073aa;
    font-weight: 500;
}

.a2e-set-cart-details summary:hover {
    text-decoration: underline;
}

.a2e-set-cart-details ul {
    margin: 8px 0 5px;
    padding: 0 0 0 18px;
    list-style: disc;
}

.a2e-set-cart-details li {
    margin: 3px 0;
    font-size: 12px;
    color: #555;
}

.a2e-set-cart-details .a2e-book-price {
    color: #999;
    font-size: 11px;
}

.a2e-set-cart-details .a2e-set-fees-note {
    margin: 5px 0 0;
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* ===== Set Product: Order Details ===== */
.a2e-order-set-books {
    margin-top: 8px;
}

.a2e-order-set-books summary {
    cursor: pointer;
    color: #0073aa;
    font-size: 13px;
}

.a2e-set-table-compact {
    font-size: 13px;
    margin-top: 5px;
}

.a2e-set-table-compact td {
    padding: 3px 8px;
    border: none;
}

/* Responsive: Set table */
@media (max-width: 768px) {
    .a2e-set-table {
        font-size: 13px;
    }

    .a2e-set-table thead th,
    .a2e-set-table tbody td,
    .a2e-set-table tfoot td {
        padding: 6px 8px;
    }

    .a2e-set-table .a2e-publisher {
        display: none;
    }
}

/* ===== Payment Slip Upload ===== */
.a2e-payment-slip-section {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.a2e-payment-slip-section h2 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
}

/* Current slip display */
.a2e-slip-current {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.a2e-slip-status-text {
    margin: 0 0 10px;
    font-weight: 600;
}

.a2e-slip-uploaded {
    color: #2e7d32;
}

.a2e-slip-date {
    display: block;
    font-weight: normal;
    font-size: 13px;
    color: #888;
    margin-top: 3px;
}

.a2e-slip-preview {
    margin-top: 10px;
}

.a2e-slip-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.a2e-slip-pdf-link {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.a2e-slip-pdf-link:hover {
    background: #eee;
    color: #0073aa;
}

/* Upload form */
.a2e-payment-slip-form {
    margin-top: 10px;
}

.a2e-slip-instruction {
    margin: 0 0 12px;
    color: #555;
    font-size: 14px;
}

.a2e-slip-upload-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.a2e-slip-file-input {
    flex: 1;
    min-width: 200px;
    padding: 8px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background: #fafafa;
}

.a2e-slip-file-hint {
    width: 100%;
    margin: 4px 0 0;
    font-size: 12px;
    color: #999;
}

.a2e-slip-upload-btn {
    padding: 10px 24px !important;
    background: #0073aa !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-size: 14px !important;
    white-space: nowrap;
}

.a2e-slip-upload-btn:hover {
    background: #005a87 !important;
}

.a2e-slip-upload-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

/* Upload messages */
.a2e-slip-message {
    margin-top: 12px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.a2e-slip-msg-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.a2e-slip-msg-error {
    background: #fef7f7;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

/* Orders list badge */
.a2e-slip-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
}

.a2e-slip-badge-uploaded {
    background: #e8f5e9;
    color: #2e7d32;
}

.a2e-slip-badge-pending {
    background: #fff3e0;
    color: #e65100;
}

/* Responsive: Payment slip */
@media (max-width: 480px) {
    .a2e-slip-upload-area {
        flex-direction: column;
        align-items: stretch;
    }

    .a2e-slip-upload-btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== Email Verification Notices ===== */
.a2e-verify-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.a2e-verify-notice p {
    margin: 0;
}

.a2e-verify-notice p + p {
    margin-top: 4px;
}

.a2e-verify-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
}

.a2e-verify-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.a2e-verify-error {
    background: #fef7f7;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

/* Resend verification */
.a2e-verify-resend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.a2e-resend-btn {
    padding: 8px 18px !important;
    font-size: 13px !important;
    white-space: nowrap;
}

.a2e-resend-msg {
    font-size: 13px;
}

.a2e-resend-ok {
    color: #2e7d32;
}

.a2e-resend-err {
    color: #c62828;
}

/* ===== Dropdown Loading States ===== */
/* Jimmy 12022026 22:58 - Loading indicators for dependent dropdowns */
.a2e-select-wrap {
    position: relative;
}

.a2e-select-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: 4px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: a2e-spin 0.7s linear infinite;
}

select.a2e-select-loading {
    color: #999;
    background-color: #f9f9f9;
}

select:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
