/**
 * Frontend CSS for Stock and Price Alert Pro
 */

/* Alert Container */
.addify-alert-container {
    margin: 20px 0;
}

/* Hide alert buttons in Quick View modals */
.modal .addify-alert-container,
.quickview .addify-alert-container,
#quickview .addify-alert-container,
.product-quickview .addify-alert-container,
[id*="quickview"] .addify-alert-container,
[class*="quickview"] .addify-alert-container {
    display: none !important;
}

/* Alert Buttons */
.addify-alert-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.stock-alert-btn {
    background-color: #007bff;
    color: #ffffff;
}

.stock-alert-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.price-alert-btn {
    background-color: #28a745;
    color: #ffffff;
}

.price-alert-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Inline Container Styles */
.addify-alert-inline-container {
    margin-top: 15px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.addify-alert-content {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.addify-alert-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.addify-alert-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    flex: 1;
    padding-right: 30px;
}

.addify-alert-body {
    padding: 20px;
    background-color: #fff;
}

.addify-alert-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s ease;
    z-index: 10;
    background: transparent;
    border: none;
}

.addify-alert-close:hover,
.addify-alert-close:focus {
    color: #000;
}

/* Form Styles */
.addify-alert-body .form-group {
    margin-bottom: 15px;
}

.addify-alert-body .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.addify-alert-body .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.addify-alert-body .btn-block {
    width: 100%;
}

/* Alert Messages */
.addify-alert-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
}

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

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

/* Customer Account Page */
.addify-account-alerts {
    padding: 20px 0;
}

.addify-account-alerts .card {
    border: 1px solid rgba(0, 0, 0, .125);
    border-radius: .25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

.addify-account-alerts .card-header {
    padding: .75rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0, 0, 0, .03);
    border-bottom: 1px solid rgba(0, 0, 0, .125);
}

.addify-account-alerts .card-header h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
}

.addify-account-alerts .card-block {
    padding: 1.25rem;
}

.alert-section {
    margin-bottom: 0;
}

.alert-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.unsubscribe-btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Table Enhancements */
.addify-account-alerts .table {
    margin-bottom: 0;
}

.addify-account-alerts .table th {
    border-top: none;
    font-weight: 600;
    color: #555;
    background-color: #f8f9fa;
}

.addify-account-alerts .table td {
    vertical-align: middle;
}

.addify-account-alerts .badge {
    padding: 0.5em 0.7em;
    font-size: 85%;
}

/* Current Price Display */
/* .current-price {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
} */

.current-price strong {
    color: #007bff;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .addify-alert-content {
        margin: 0;
    }

    .addify-alert-btn {
        width: 100%;
        justify-content: center;
    }

    .addify-alert-header {
        padding: 12px 15px;
    }

    .addify-alert-header h3 {
        font-size: 16px;
    }

    .addify-alert-body {
        padding: 15px;
    }
}

/* Icon Styles */
.addify-alert-btn .material-icons {
    font-size: 18px;
}

/* Loading State */
.addify-alert-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.addify-alert-btn.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.mt-1 {
    margin-top: 0rem !important
}

/* Icon Styles */
.addify-alert-icon {
    max-width: 50px;
    max-height: 50px;
    margin-bottom: 10px;
    display: inline-block;
}

.addify-alert-icon.round {
    border-radius: 50%;
}

.addify-alert-icon.square {
    border-radius: 0;
}

/* Icon Placement */
.addify-alert-icon-wrapper {
    text-align: center;
    /* Default to center/top_middle */
    padding: 0 20px;
    margin-top: 15px;
}

.addify-alert-icon-wrapper.top_left {
    text-align: left;
}

.addify-alert-icon-wrapper.top_right {
    text-align: right;
    padding-right: 60px;
}

/* Confirmation Box Styles (Modal) */
.aspa-confirmation-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.aspa-confirmation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 10001;
    animation: fadeIn 0.3s ease-out;
}

.aspa-confirmation-box {
    position: relative;
    width: 320px;
    background: white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 24px;
    z-index: 10002;
    text-align: center;
    border: 1px solid #f0f0f0;
    animation: scaleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.aspa-confirm-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}

.aspa-confirm-desc {
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.aspa-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.aspa-btn-confirm,
.aspa-btn-cancel {
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.aspa-btn-confirm {
    background-color: #dc3545;
    color: white;
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

.aspa-btn-confirm:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.aspa-btn-cancel {
    background-color: #e9ecef;
    color: #495057;
}

.aspa-btn-cancel:hover {
    background-color: #dee2e6;
    color: #212529;
}

/* Custom Pagination Styles */
.addify-account-alerts .pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.375rem;
    margin: 0;
    gap: 0.25rem;
}

.addify-account-alerts .pagination .page-item {
    margin: 0;
}

.addify-account-alerts .pagination .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: 0;
    line-height: 1.25;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
    font-weight: 500;
}

.addify-account-alerts .pagination .page-link:hover {
    z-index: 2;
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

.addify-account-alerts .pagination .page-link:focus {
    z-index: 3;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.addify-account-alerts .pagination .page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    cursor: default;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.addify-account-alerts .pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: not-allowed;
    background-color: #fff;
    border-color: #dee2e6;
    opacity: 0.6;
}

/* Pagination information text */
.addify-account-alerts .pagination-info {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 2.5;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .addify-account-alerts .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .addify-account-alerts .pagination .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .addify-account-alerts .pagination-info {
        text-align: center;
        margin-bottom: 1rem;
    }

    .addify-account-alerts .row.mt-3 {
        flex-direction: column-reverse;
    }

    .addify-account-alerts .row.mt-3 .col-md-6 {
        width: 100%;
    }
}

/* Combined Actions Bar (Filter + Bulk Actions) - Two Row Layout */
.aspa-actions-bar {
    display: block !important;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.aspa-actions-row-top {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
}

.aspa-actions-row-top .aspa-filter-heading {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    margin: 0;
}

.aspa-actions-row-top .selected-count {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
}

.aspa-actions-row-bottom {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}


/* Filter Buttons Section */
.aspa-filter-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.aspa-filter-btn {
    padding: 8px 18px;
    border: 2px solid #007bff;
    background-color: transparent;
    color: #007bff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
    white-space: nowrap;
}

.aspa-filter-btn:hover {
    background-color: #007bff;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25);
}

.aspa-filter-btn.active {
    background-color: #007bff;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.aspa-filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Bulk Actions Section */
.aspa-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Legacy bulk actions bar (keep for backwards compatibility) */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.bulk-unsubscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-unsubscribe-btn:hover:not(:disabled) {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.bulk-unsubscribe-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.bulk-unsubscribe-btn .material-icons {
    font-size: 18px;
}

.selected-count {
    font-size: 13px;
    font-weight: 500;
}

/* Checkbox styles */
.select-all-checkbox,
.subscription-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #007bff;
}

.select-all-checkbox:indeterminate {
    accent-color: #6c757d;
}

/* ID Badge */
.addify-account-alerts .table .badge-secondary {
    background-color: #6c757d;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    font-weight: 500;
}

/* ============================================
   TABLET RESPONSIVE (769px - 1024px)
   For iPad Air, iPad Pro, and similar tablets
   ============================================ */
@media (max-width: 1024px) and (min-width: 769px) {

    /* Actions bar adjustments for tablets */
    .aspa-actions-bar {
        padding: 12px 0;
    }

    .aspa-filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Table adjustments for tablets */
    .addify-account-alerts .table {
        font-size: 14px;
    }

    .addify-account-alerts .table th,
    .addify-account-alerts .table td {
        padding: 10px 6px;
    }

    /* Product cell - keep horizontal but add better spacing */
    .addify-account-alerts .table td:nth-child(2) a {
        gap: 8px;
    }

    .addify-account-alerts .table td:nth-child(2) .img-thumbnail {
        width: 60px !important;
        height: auto;
        flex-shrink: 0;
    }

    .addify-account-alerts .table td:nth-child(2) div {
        flex: 1;
        min-width: 0;
    }

    .addify-account-alerts .table td:nth-child(2) span {
        word-break: break-word;
        line-height: 1.4;
    }

    /* Alert type column - ensure price shows properly */
    .addify-account-alerts .table td:nth-child(3) small {
        font-size: 11px;
    }

    /* Reduce action button size */
    .addify-account-alerts .table .unsubscribe-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* ============================================
   MOBILE RESPONSIVE (max-width: 768px)
   For phones and small tablets
   ============================================ */
@media (max-width: 768px) {
    .bulk-actions-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .bulk-unsubscribe-btn {
        width: 100%;
        justify-content: center;
    }

    .selected-count {
        width: 100%;
        text-align: center;
    }

    /* Responsive combined actions bar */
    .aspa-actions-bar {
        padding: 10px 0 !important;
    }

    .aspa-actions-row-top {
        flex-direction: row !important;
        justify-content: space-between !important;
        margin-bottom: 8px !important;
    }

    .aspa-actions-row-top .aspa-filter-heading {
        font-size: 13px;
    }

    .aspa-actions-row-top .selected-count {
        font-size: 12px;
    }

    .aspa-actions-row-bottom {
        flex-direction: column !important;
        gap: 10px;
    }

    .aspa-filter-buttons {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .aspa-filter-btn {
        flex: 1 1 calc(33.333% - 6px);
        min-width: 90px;
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .aspa-bulk-actions {
        width: 100%;
    }

    .aspa-bulk-actions .bulk-unsubscribe-btn {
        width: 100%;
        justify-content: center;
    }

    /* Make table responsive - product cell specific */
    .addify-account-alerts .table td:nth-child(2) a {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 8px;
    }

    .addify-account-alerts .table td:nth-child(2) .img-thumbnail {
        margin-right: 0 !important;
        margin-bottom: 0;
        width: 60px !important;
        height: auto;
    }

    .addify-account-alerts .table td:nth-child(2) div {
        width: 100%;
    }

    /* Ensure table cells stack properly */
    .addify-account-alerts .table {
        font-size: 13px;
    }

    .addify-account-alerts .table th,
    .addify-account-alerts .table td {
        padding: 10px 6px;
        word-wrap: break-word;
        vertical-align: middle;
    }

    /* Fix alert type badges and price info */
    .addify-account-alerts .table td:nth-child(3) {
        min-width: 110px;
    }

    .addify-account-alerts .table td:nth-child(3) .badge {
        display: block;
        margin: 0 auto 6px;
        width: fit-content;
    }

    .addify-account-alerts .table td:nth-child(3) small {
        display: block;
        margin-top: 4px;
        line-height: 1.3;
    }

    .addify-account-alerts .table .badge {
        font-size: 11px;
        padding: 5px 8px;
    }

    /* Action buttons responsive */
    .addify-account-alerts .table .unsubscribe-btn {
        font-size: 11px;
        padding: 6px 10px;
        white-space: nowrap;
    }

    /* Checkbox column width */
    .addify-account-alerts .table th:first-child,
    .addify-account-alerts .table td:first-child {
        width: 35px;
        padding: 10px 4px;
    }

    /* Date column */
    .addify-account-alerts .table td:nth-child(4) {
        font-size: 12px;
    }
}

/* ============================================
   SMALL MOBILE RESPONSIVE (max-width: 576px)
   For very small phone screens
   ============================================ */
@media (max-width: 576px) {

    /* Further reduce padding for small screens */
    .addify-account-alerts .card-block {
        padding: 0.75rem;
    }

    /* Stack filter buttons vertically on very small screens */
    .aspa-filter-btn {
        flex: 1 1 100%;
        max-width: 100%;
    }

    /* Reduce table font size further */
    .addify-account-alerts .table {
        font-size: 12px;
    }

    .addify-account-alerts .table th,
    .addify-account-alerts .table td {
        padding: 8px 3px;
    }

    /* Smaller product images on very small screens */
    .addify-account-alerts .table td:nth-child(2) .img-thumbnail {
        width: 50px !important;
    }

    /* Product name text size */
    .addify-account-alerts .table td:nth-child(2) span {
        font-size: 12px;
        line-height: 1.3;
    }

    .addify-account-alerts .table td:nth-child(2) small {
        font-size: 10px;
    }

    /* Smaller badges */
    .addify-account-alerts .table .badge {
        font-size: 10px;
        padding: 4px 6px;
    }

    /* Smaller action buttons */
    .addify-account-alerts .table .unsubscribe-btn {
        font-size: 10px;
        padding: 5px 8px;
    }

    /* Alert type column with price */
    .addify-account-alerts .table td:nth-child(3) small {
        font-size: 10px;
    }

    /* Date column */
    .addify-account-alerts .table td:nth-child(4) {
        font-size: 11px;
    }

    /* Checkbox smaller */
    .select-all-checkbox,
    .subscription-checkbox {
        width: 16px;
        height: 16px;
    }

    .addify-account-alerts .table th:first-child,
    .addify-account-alerts .table td:first-child {
        width: 30px;
        padding: 8px 2px;
    }
}

/* ============================================
   EXTRA SMALL MOBILE (max-width: 375px)
   For iPhone SE and similar small devices
   ============================================ */
@media (max-width: 375px) {
    .addify-account-alerts .card-block {
        padding: 0.5rem;
    }

    .addify-account-alerts .table {
        font-size: 11px;
    }

    .addify-account-alerts .table td:nth-child(2) .img-thumbnail {
        width: 45px !important;
    }

    .addify-account-alerts .table td:nth-child(2) span {
        font-size: 11px;
    }

    .addify-account-alerts .table .badge {
        font-size: 9px;
        padding: 3px 5px;
    }

    .addify-account-alerts .table .unsubscribe-btn {
        font-size: 9px;
        padding: 4px 6px;
    }
}