/**
 * WooCommerce Customer Dashboard Styles - Modern Flat Design
 */

/* Main Dashboard Container */
.woo-customer-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    color: #333;
    background-color: #f8f8f8;
    border-radius: 7px;
}

.woo-customer-dashboard h2 {
    font-size: 28px;
    margin-bottom: 25px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: none;
    padding-bottom: 10px;
}

/* Dashboard Row Layout */
.dashboard-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 3px;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

/* Dashboard Cards */
.dashboard-card {
    flex: 1 1 300px;
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dashboard-card h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 20px;
    font-family: "Petrov - semi bold", Sans-serif;
    color: #2c3e50;
    border-bottom: none;
    padding-bottom: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.dashboard-card h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: #cbc5ff;
    margin-right: 10px;
    border-radius: 2px;
}

/* Statistics Box */
.stat-box {
    text-align: center;
    padding: 20px 0;
    position: relative;
    background-image: url('../images/shield-badge.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 80%;
    background-blend-mode: soft-light;
    background-color: rgba(255, 255, 255, 0.9);
}

.stat-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: #5fb88d;
    line-height: 1.2;
    position: relative;
    z-index: 2;
}

.stat-label {
    display: block;
    font-size: 16px;
    color: #7f8c8d;
    margin-top: 5px;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* Chart Container */
.chart-container {
    height: 300px;
    position: relative;
}

/* Recent Orders Table */
.recent-orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    border-radius: 7px;
    overflow: hidden;
}

.recent-orders-table th {
    text-align: left;
    padding: 16px 14px;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border: none;
}

.recent-orders-table td {
    padding: 16px 14px;
    border-top: 1px solid #edf2f7;
    vertical-align: middle;
}

.recent-orders-table tr:last-child td {
    border-bottom: none;
}

.recent-orders-table tr:hover td {
    background-color: #fafbfc;
}

/* Order Status */
.order-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.order-status-completed {
    background-color: #e3fcef;
    color: #0e9f6e;
}

.order-status-processing {
    background-color: #e1f0ff;
    color: #3182ce;
}

.order-status-on-hold {
    background-color: #fef3c7;
    color: #d97706;
}

.order-status-pending {
    background-color: #f3f4f6;
    color: #6b7280;
}

.order-status-failed {
    background-color: #fee2e2;
    color: #dc2626;
}

.order-status-cancelled {
    background-color: #f3f4f6;
    color: #6b7280;
}

.order-status-refunded {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* View Order Button */
.view-order-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #666970;
    color: #fff;
    text-decoration: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.view-order-btn:hover {
    background-color: #5fb88d;
    color: #fff;
    transform: translateY(-2px);
}

/* Recommended Products */
.recommended-products {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Reduced from 24px */
    margin-top: 20px;
    width: 100%;
}

.product-card {
    flex: 1 1 200px;
    max-width: calc(25% - 6px); /* Adjusted for smaller gap */
    background: #fff;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(78, 127, 255, 0.15);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    height: 150px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    position: relative;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-title {
    font-size: 16px;
    margin: 15px 15px 10px;
    font-weight: 600;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    padding: 0 15px 15px;
    font-weight: 700;
    color: #b7b7b7;
    font-size: 15px;
}

.add-to-cart-btn {
    display: block;
    text-align: center;
    background-color: #36383d;
    color: #fff;
    padding: 7px 15px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border-radius: 0 0 7px 7px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: all 0.6s;
}

.add-to-cart-btn:hover::before {
    left: 100%;
}

.add-to-cart-btn .dashicons {
    vertical-align: middle;
    margin-right: -2px;
    font-size: 16px;
    line-height: 1;
}

.add-to-cart-btn:hover {
    background-color: #5fb88d;
    color: #fff;
}

.view-all-orders {
    text-align: right;
    margin-top: 15px;
}

.view-all-orders a {
    color: #b3b3b3;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.view-all-orders a:after {
    content: '→';
    margin-left: 5px;
    font-size: 16px;
}

.view-all-orders a:hover {
    color: #5fb88d;
    text-decoration: none;
}

/* Stats indicators */
.stat-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.05);
}

.stat-indicator.up {
    color: #0e9f6e;
}

.stat-indicator.down {
    color: #dc2626;
}

.stat-indicator:before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 5px;
}

.stat-indicator.up:before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid #0e9f6e;
}

.stat-indicator.down:before {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #dc2626;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .dashboard-row {
        flex-direction: column;
        margin: 0 0 2px;
        gap: 16px;
        width: 100%;
    }
    
    .dashboard-card {
        flex: 1 1 100%;
        margin-bottom: 16px;
        padding: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .product-card {
        max-width: calc(50% - 8px);
    }
    
    .chart-container {
        height: 250px;
        width: 100%;
        max-width: 100%;
    }
    
    .stat-number {
        font-size: 36px;
    }
}

@media (max-width: 600px) {
    .woo-customer-dashboard {
        padding: 15px 10px;
        border-radius: 7px;
    }
    
    .dashboard-row {
        gap: 12px;
    }
    
    .dashboard-card {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 7px;
    }
    
    .dashboard-card h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .recommended-products {
        gap: 10px;
    }
    
    .product-card {
        max-width: 100%;
        flex: 1 1 100%;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-title {
        font-size: 14px;
        margin: 12px 12px 8px;
        height: 40px;
    }
    
    .product-price {
        padding: 0 12px 12px;
        font-size: 15px;
    }
    
    .add-to-cart-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .product-card {
        max-width: 100%;
        width: -webkit-fill-available;
    }
    
    .woo-customer-dashboard {
        padding: 12px 8px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Make Order Status more compact */
    .order-status {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    /* Make View button smaller */
    .view-order-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .stat-box {
        padding: 15px 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .stat-label {
        font-size: 14px;
    }
    
    .chart-container {
        height: 200px;
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure canvas in chart container is responsive */
    .chart-container canvas {
        max-width: 100%;
        height: auto !important;
    }
    
    /* Additional responsive fixes */
    @media (max-width: 600px) {
        .woo-customer-dashboard {
            padding: 15px 10px;
            border-radius: 7px;
            overflow-x: hidden;
        }
        
        .dashboard-row {
            gap: 12px;
            width: 100%;
            box-sizing: border-box;
            overflow: hidden;
        }
        
        canvas#purchase-timeline {
            max-width: 100%;
            width: 100% !important;
        }
    }
    
    /* Ensure dashboard cards don't overflow */
    .dashboard-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
        padding: 12px;
    }
    
    /* Ensure dashboard row doesn't overflow */
    .dashboard-row {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
    }
}

/* Table scrolling for medium-small screens */
@media (max-width: 600px) and (min-width: 481px) {
    .recent-orders-table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-radius: 7px;
        width: 100%;
        max-width: 100%;
    }
    
    .recent-orders-table th,
    .recent-orders-table td {
        padding: 10px 8px;
    }
    
    /* Hide Date column on mobile */
    .recent-orders-table th:nth-child(2),
    .recent-orders-table td:nth-child(2) {
        display: none;
    }
}

/* Card layout for small screens */
@media (max-width: 480px) {
    .recent-orders-table,
    .recent-orders-table thead,
    .recent-orders-table tbody,
    .recent-orders-table th,
    .recent-orders-table td,
    .recent-orders-table tr {
        display: block;
    }
    
    .recent-orders-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .recent-orders-table tr {
        margin-bottom: 15px;
        border-radius: 7px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        background-color: #fff;
        padding: 10px;
    }
    
    .recent-orders-table td {
        border: none;
        position: relative;
        padding: 8px 8px 8px 50%;
        white-space: normal;
        text-align: left;
    }
    
    .recent-orders-table td:before {
        position: absolute;
        top: 8px;
        left: 8px;
        width: 45%;
        padding-right: 10px;
        font-weight: 600;
        content: attr(data-title);
    }
    
    /* Show all columns in card view */
    .recent-orders-table td:nth-child(2) {
        display: block;
    }
    
    /* Adjust view all orders link */
    .view-all-orders {
        text-align: center;
        margin-top: 15px;
    }
    
    /* Adjust recommended products section */
    .recommended-products {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }
}