/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* ========================================
   Event Logs Styles
   ======================================== */

/* Container */
.swc-event-logs-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.swc-event-logs-container h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

/* Statistics Summary */
.swc-stats-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.swc-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #fff;
}

.swc-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.swc-stat-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.swc-stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

/* Filters */
.swc-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.swc-filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.swc-filter-form select {
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: #fff;
    font-size: 14px;
    color: #495057;
    min-width: 150px;
    transition: border-color 0.2s;
}

.swc-filter-form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.swc-filter-form .button {
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.swc-filter-form .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Events Table */
.swc-events-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.swc-events-table th,
.swc-events-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.swc-events-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swc-events-table tbody tr {
    transition: background-color 0.2s;
}

.swc-events-table tbody tr:hover {
    background: #f8f9fa;
}

.swc-events-table tbody tr:last-child td {
    border-bottom: none;
}

/* Row highlighting */
.swc-child-action {
    background: #fff9e6 !important;
}

.swc-child-action:hover {
    background: #fff3cd !important;
}

.swc-master-action {
    background: #fff;
}

/* Date & Time */
.swc-date {
    display: block;
    font-weight: 500;
    color: #333;
}

.swc-time {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

/* User Info */
.swc-user-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.swc-user-info strong {
    color: #333;
}

.swc-unknown-user {
    color: #6c757d;
    font-style: italic;
}

/* Badges */
.swc-user-badge,
.swc-section-badge,
.swc-action-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* User Badges */
.swc-linked-badge {
    background: #ffc107;
    color: #000;
}

.swc-master-badge {
    background: #28a745;
    color: #fff;
}

/* Section Badges */
.swc-section-address_book {
    background: #007bff;
    color: #fff;
}

.swc-section-orders {
    background: #28a745;
    color: #fff;
}

.swc-section-csv_import {
    background: #6f42c1;
    color: #fff;
}

.swc-section-authentication {
    background: #17a2b8;
    color: #fff;
}

/* Action Badges */
.swc-action-created {
    background: #28a745;
    color: #fff;
}

.swc-action-updated {
    background: #28a745;
    color: #000;
}

.swc-action-deleted {
    background: #28a745;
    color: #fff;
}

.swc-action-viewed {
    background: #28a745;
    color: #fff;
}

.swc-action-downloaded,
.swc-action-uploaded {
    background: #28a745;
    color: #fff;
}

.swc-action-set_default {
    background: #28a745;
    color: #fff;
}

.swc-action-login,
.swc-action-logout {
    background: #28a745;
    color: #fff;
}

/* Event Description */
.swc-event-description {
    color: #495057;
    font-size: 14px;
}

.swc-event-description strong {
    color: #333;
}

/* IP Address */
.swc-ip {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #495057;
}

/* Pagination */
.swc-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.swc-pagination .button {
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.swc-pagination .button:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.swc-pagination .button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.swc-page-info {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Total Count */
.swc-total-count {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    font-size: 13px;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {

    /* Stats Cards */
    .swc-stats-summary {
        flex-direction: column;
    }

    .swc-stat-card {
        min-width: 100%;
    }

    /* Filter Form */
    .swc-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .swc-filter-form select,
    .swc-filter-form .button {
        width: 100%;
        min-width: 100%;
    }

    /* Table to Cards */
    .swc-events-table {
        border: 0;
    }

    .swc-events-table thead {
        display: none;
    }

    .swc-events-table tbody,
    .swc-events-table tr,
    .swc-events-table td {
        display: block;
        width: 100%;
    }

    .swc-events-table tr {
        margin-bottom: 15px;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 15px;
        background: #fff;
    }

    .swc-events-table td {
        padding: 8px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    .swc-events-table td:before {
        content: attr(data-title);
        font-weight: 600;
        color: #6c757d;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 10px;
        min-width: 100px;
    }

    .swc-events-table td>* {
        text-align: right;
    }

    /* Pagination */
    .swc-pagination {
        flex-direction: column;
        gap: 10px;
    }

    .swc-pagination .button {
        width: 100%;
        text-align: center;
    }

    .swc-page-info {
        order: -1;
    }
}

/* Print Styles */
@media print {

    .swc-filters,
    .swc-pagination {
        display: none;
    }

    .swc-events-table {
        box-shadow: none;
    }

    .swc-child-action {
        background: #f8f9fa !important;
    }
}

/* Loading State */
.swc-loading-overlay {
    position: relative;
}

.swc-loading-overlay:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Empty State */
.woocommerce-info {
    padding: 20px;
    background: #f0f8ff;
    border-left: 4px solid #008080;
    border-radius: 4px;
    margin: 20px 0;
}



/* Enhanced Activity Log Styles */

.account-access-log {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.account-access-log h3 {
    margin-top: 0;
    margin-bottom: 25px;


    padding-bottom: 10px;
}

/* Filter Section */
.log-filters {
    background: #f7f7f7;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 6px;
}

.log-filters .filter-row {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.log-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.log-filters label {
    font-weight: 600;
    color: #555;
    margin: 0;
    font-size: 14px;
}

.log-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    width: 100%;
}

.log-filters button.fltr {
    background: #008080;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.log-filters button.fltr:hover {
    background: #043f3f;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.log-filters .clear-filters {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.log-filters .clear-filters:hover {
    background: #e0e0e0;
    color: #333;
}

/* Table Styles */
.access_log_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.access_log_table thead {
    background: linear-gradient(135deg, #008080 0%, #008080 100%);
}

.access_log_table thead th {
    color: #fff !important;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.access_log_table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.access_log_table tbody tr:hover {
    background: #f9f9f9;
}

.access_log_table tbody td {
    padding: 15px 12px;
    vertical-align: middle;
    font-size: 14px;
    color: #555;
}

/* Action Details Cell */
.action-details-cell {
    font-weight: 500;
}

/* Action Badge Styles */
.action-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-badge .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}



/* Order Links in Description */
.action-badge a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

.action-badge a:hover {
    text-decoration: none;
}

/* No Logs Message */
.no-logs {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
    font-style: italic;
}

/* Pagination */
.log-pagination {
    margin-top: 30px;
    text-align: center;
}

.log-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
}

.log-pagination .page-numbers:hover {
    background: #008080;
    color: #fff;
    border-color: #008080;
}

.log-pagination .page-numbers.current {
    background: #008080;
    color: #fff;
    border-color: #008080;
    font-weight: 600;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .account-access-log {
        padding: 20px 15px;
    }

    .log-filters .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .log-filters .filter-group {
        width: 100%;
        min-width: unset;
    }

    .log-filters select {
        width: 100%;
    }

    .log-filters button.fltr,
    .log-filters .clear-filters {
        width: 100%;
        text-align: center;
    }

    .access_log_table {
        border: 0;
    }

    .access_log_table thead {
        display: none;
    }

    .access_log_table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 6px;
        overflow: hidden;
    }

    .access_log_table tbody td {
        display: block;
        text-align: right;
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
    }

    .access_log_table tbody td:last-child {
        border-bottom: 0;
    }

    .access_log_table tbody td:before {
        content: attr(data-title);
        float: left;
        font-weight: 600;
        color: #333;
    }

    .action-details-cell {
        text-align: left !important;
    }

    .action-badge {
        width: 100%;
        justify-content: center;
    }
}

/* Loading State */
.access-log-loading {
    text-align: center;
    padding: 40px;
}

.access-log-loading:after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #008080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}