/**
 * WC Artist Dashboard - Frontend Styles
 * Cleaned & Modernized - Version 2.0
 * Single source of truth for tabs, cards, and layout.
 * No duplicate rules. Modern pill-style navigation.
 * 
 * NOTE: ALL PLAYER STYLES HAVE BEEN REMOVED
 * Player styles are now in /modules/wad-player/assets/wad-player.css
 * All .wad-play-preview styles replaced with .wad-play-trigger
 * 
 * UPGRADED: Global Montserrat font override for all plugin UI elements
 * UPGRADED: Dark theme tables for My Products & Collaborations (non-finance tables)
 */

/* ============================================
   GLOBAL PLUGIN FONT OVERRIDE
   Forces Montserrat across all plugin UI
============================================ */

.wad-dashboard-wrapper,
.wad-dashboard-wrapper *,
.wad-single-purchase-panel,
.wad-single-purchase-panel *,
.wad-play-trigger,
.wad-shop-preview-btn,
.single-product .summary,
.single-product .summary * {
    font-family: 'WADMontserrat', sans-serif !important;
}

/* ====================== MAIN WRAPPER ====================== */
.wad-dashboard-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'WADMontserrat', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ====================== HEADER ====================== */
.wad-header {
    padding: 25px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 30px;
}

.wad-header h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 600;
    color: #222;
}

.wad-header p {
    margin: 0;
    font-size: 15px;
    color: #666;
}

/* ====================== MODERN PILL TABS ====================== */
.wad-tabs-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 30px;
}

.wad-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wad-tabs a {
    padding: 10px 20px;
    border-radius: 30px;
    background: #f5f5f5;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.wad-tabs a:hover {
    background: #0073aa;
    color: #fff;
}

.wad-tabs a.active {
    background: #0073aa;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0, 115, 170, 0.25);
}

/* Mobile: Stack tabs vertically */
@media (max-width: 768px) {
    .wad-tabs {
        flex-direction: column;
    }
    .wad-tabs a {
        text-align: center;
        padding: 12px 16px;
    }
}

/* ====================== SUMMARY CARDS ====================== */
.wad-summary-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 35px;
}

.wad-summary-box {
    flex: 1;
    min-width: 200px;
    padding: 22px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.wad-summary-box h3 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wad-summary-box p {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #222;
}

/* ====================== DARK THEME TABLES ====================== */
/* My Products, Collaborations, and all non-finance dashboard tables */
.wad-table-container,
.wad-table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
}

.wad-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    background: #1f1f1f !important;
    color: #ffffff !important;
    border-radius: 8px;
    overflow: hidden;
}

.wad-table th {
    background: #2a2a2a !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    padding: 14px 15px;
    text-align: left;
    border-bottom: 1px solid #444 !important;
}

.wad-table td {
    background: #333333 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 14px 15px;
    border-bottom: 1px solid #444 !important;
    vertical-align: middle;
}

.wad-table tr:nth-child(even) td {
    background: #2a2a2a !important;
}

.wad-table tr:hover td {
    background: #3c3c3c !important;
}

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

/* Table links in dark theme */
.wad-table a {
    color: #1db954 !important;
    text-decoration: none;
    font-weight: 600;
}

.wad-table a:hover {
    color: #1ed760 !important;
    text-decoration: underline;
}

/* ====================== WITHDRAWAL FORM ====================== */
.wad-withdrawal-form-container {
    background: #f8f9fa;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 35px;
}

.wad-withdrawal-form-container h3 {
    margin: 0 0 18px 0;
    font-size: 18px;
    font-weight: 600;
}

.wad-form-group {
    margin-bottom: 18px;
}

.wad-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.wad-form-group input,
.wad-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

/* ====================== BUTTONS ====================== */
.wad-order-filter-container button,
.wad-order-filter-container .button,
.wad-withdrawal-form-container button,
.wad-withdrawal-form-container .button,
.wad-content button,
.wad-content .button {
    display: inline-block;
    padding: 10px 18px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.wad-order-filter-container button:hover,
.wad-order-filter-container .button:hover,
.wad-withdrawal-form-container button:hover,
.wad-withdrawal-form-container .button:hover,
.wad-content button:hover,
.wad-content .button:hover {
    background: #005a87;
}

/* ====================== STATUS ====================== */
.wad-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
}

.status-pending  { background-color: #ffc107; color: #000; }
.status-paid     { background-color: #28a745; color: #fff; }
.status-declined { background-color: #dc3545; color: #fff; }
.status-cancelled{ background-color: #6c757d; color: #fff; }

/* ====================== MOBILE RESPONSIVE ====================== */
@media screen and (max-width: 768px) {
    .wad-dashboard-wrapper {
        padding: 12px;
    }
    
    .wad-header {
        padding: 18px;
    }
    
    .wad-header h1 {
        font-size: 24px;
    }
    
    .wad-content-section {
        padding: 18px;
    }
    
    .wad-summary-boxes {
        flex-direction: column;
    }
    
    .wad-summary-box {
        margin-bottom: 15px;
    }
    
    .wad-form-group input,
    .wad-form-group textarea {
        font-size: 16px;
    }
    
    button, .button {
        width: 100%;
        margin: 6px 0;
    }
    
    /* Mobile table adjustments */
    .wad-table {
        font-size: 14px;
        min-width: 500px;
    }
    
    .wad-table th,
    .wad-table td {
        padding: 10px 12px;
    }
}

@media screen and (max-width: 480px) {
    .wad-tabs a {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .wad-table th,
    .wad-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}

.wad-summary-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.wad-request-id {
    font-weight: 600;
    color: #0073aa;
    font-family: monospace;
}

/* Fix instant checkout wrapper spacing - remove default margins */
#instant-checkout-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   CHECKOUT & ORDER TABLES DARK THEME FIXES
   Scope: ONLY WooCommerce checkout + order pages
============================================ */

/* Target BOTH pages safely */
.woocommerce-checkout table,
.woocommerce-order table,
.woocommerce-view-order table {
    background: #181818 !important;
    border: 1px solid #2a2a2a !important;
    border-radius: 8px;
    overflow: hidden;
}

/* Table headers */
.woocommerce-checkout table th,
.woocommerce-order table th,
.woocommerce-view-order table th {
    background: #111 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #333 !important;
    font-weight: 600;
    padding: 12px 16px;
}

/* Table cells */
.woocommerce-checkout table td,
.woocommerce-order table td,
.woocommerce-view-order table td {
    background: #181818 !important;
    color: #e0e0e0 !important;
    border-bottom: 1px solid #2a2a2a !important;
    padding: 12px 16px;
}

/* Product links */
.woocommerce-checkout table td a,
.woocommerce-order table td a,
.woocommerce-view-order table td a {
    color: #1db954 !important;
    text-decoration: none;
    font-weight: 500;
}

.woocommerce-checkout table td a:hover,
.woocommerce-order table td a:hover,
.woocommerce-view-order table td a:hover {
    color: #1ed760 !important;
    text-decoration: underline;
}

/* Totals highlight */
.woocommerce-checkout .order-total td,
.woocommerce-order .order-total td,
.woocommerce-view-order .order-total td {
    color: #1db954 !important;
    font-weight: bold;
    font-size: 1.1em;
}

/* Cart totals section */
.cart_totals table,
.shop_table.cart,
.shop_table.woocommerce-checkout-review-order-table {
    background: #181818 !important;
    border-color: #2a2a2a !important;
}

.cart_totals th,
.cart_totals td,
.shop_table.cart th,
.shop_table.cart td {
    background: #181818 !important;
    color: #e0e0e0 !important;
    border-color: #2a2a2a !important;
}

/* Download button (Thank You page) */
.woocommerce-order .download-file a,
.woocommerce-MyAccount-downloads .download-file a {
    background: #1db954 !important;
    color: #000 !important;
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 600;
    display: inline-block;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.woocommerce-order .download-file a:hover,
.woocommerce-MyAccount-downloads .download-file a:hover {
    background: #1ed760 !important;
    transform: scale(1.02);
    color: #000 !important;
}

/* Order overview on thank you page */
.woocommerce-order-overview {
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 15px;
}

.woocommerce-order-overview li {
    color: #e0e0e0;
}

.woocommerce-order-overview li strong {
    color: #fff;
}

/* ============================================
   DASHBOARD LAYOUT STABILITY FIXES
============================================ */

/* FIXED: Dashboard layout stability */
.wad-dashboard-wrapper {
    clear: both;
    width: 100%;
    overflow: visible;
}

.wad-content-section {
    clear: both;
    width: 100%;
    overflow: visible;
}

/* FIXED: Withdrawal History Table stability */
.wad-table-container {
    clear: both;
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

.wad-table {
    width: 100%;
    border-collapse: collapse;
    clear: both;
}

.wad-summary-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    clear: both;
    margin: 20px 0;
}

.wad-summary-box {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.wad-withdrawal-form-container {
    clear: both;
    margin: 20px 0;
}

/* FIXED: Sold Units wrapper - prevents layout breaking */
.wad-sold-units-wrapper {
    clear: both;
    width: 100%;
    margin: 10px 0;
}

.wad-sold-units {
    display: block;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #555;
}

/* Shop page sold units */
.wad-sold-units-shop {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    clear: both;
}

/* ============================================
   PROFESSIONAL SINGLE PRODUCT PURCHASE PANEL
   Spotify/Boomplay-inspired dark UI
============================================ */

.single-product div.product .summary {
    background: #000;
    padding: 0 20px 30px;
    border-radius: 0;
}

.wad-single-purchase-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

/* Price Box */
.single-product div.product p.price {
    margin: 0 !important;
    order: 1;
}

.single-product div.product p.price .woocommerce-Price-amount {
    display: block;
    width: 100%;
    background: #e8e8e8;
    color: #111;
    font-weight: 900;
    font-size: 2rem;
    line-height: 1;
    padding: 18px 20px;
    border-radius: 7px;
    letter-spacing: -0.5px;
    text-align: center;
}

/* Sold Units Box */
.wad-single-info-box {
    width: 100%;
    background: #e8e8e8;
    color: #111;
    font-weight: 900;
    font-size: 1.6rem;
    padding: 16px 20px;
    border-radius: 7px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wad-box-label {
    font-weight: 900;
}

.wad-box-value {
    font-weight: 900;
}

/* Preview Button Box */
.wad-single-preview-box {
    width: 100%;
    background: #e8e8e8;
    padding: 14px 16px;
    border-radius: 7px;
    text-align: center;
}

/* Play Trigger Button styling */
.wad-play-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1ed760;
    color: #000;
    border: none;
    border-radius: 999px;
    min-height: 40px;
    padding: 0 18px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wad-play-trigger:hover {
    transform: scale(1.03);
    background: #21e065;
}

/* Mini Icon inside trigger */
.wad-play-trigger .wad-mini-icon {
    position: relative;
    width: 18px;
    height: 18px;
    display: inline-block;
}

.wad-play-trigger .wad-mini-icon.play::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #000;
}

/* Buy Button */
.single-product form.cart {
    margin: 0 !important;
}

.single-product form.cart .quantity {
    display: none !important;
}

.single-product form.cart button.single_add_to_cart_button,
.single-product #trigger-instant-checkout {
    width: 100% !important;
    background: #e8e8e8 !important;
    color: #111 !important;
    border: none !important;
    border-radius: 7px !important;
    min-height: 64px !important;
    font-size: 2rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.5px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 20px !important;
    box-shadow: none !important;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.single-product form.cart button.single_add_to_cart_button:hover,
.single-product #trigger-instant-checkout:hover {
    background: #ffffff !important;
    transform: translateY(-1px);
}

/* Remove Extra Clutter */
.single-product .product_meta {
    display: none !important;
}

.single-product .woocommerce-product-rating {
    display: none !important;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .single-product div.product .summary {
        padding: 0 14px 24px;
    }
    
    .single-product div.product p.price .woocommerce-Price-amount {
        font-size: 1.8rem;
        padding: 16px 18px;
    }
    
    .wad-single-info-box {
        font-size: 1.4rem;
        padding: 15px 18px;
    }
    
    .single-product form.cart button.single_add_to_cart_button,
    .single-product #trigger-instant-checkout {
        min-height: 58px !important;
        font-size: 1.7rem !important;
        padding: 0 18px !important;
    }
    
    .wad-play-trigger {
        min-height: 36px;
        padding: 0 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .wad-single-info-box {
        font-size: 1.2rem;
        padding: 12px 16px;
    }
}

/* ============================================
   DARK THEME EXTENSIONS - Additional tables
============================================ */

/* Ensure any table inside dashboard wrapper gets dark theme */
.wad-dashboard-wrapper table:not(.woocommerce-table):not(.shop_table) {
    background: #1f1f1f !important;
    color: #ffffff !important;
}

.wad-dashboard-wrapper table:not(.woocommerce-table):not(.shop_table) th {
    background: #2a2a2a !important;
    color: #ffffff !important;
}

.wad-dashboard-wrapper table:not(.woocommerce-table):not(.shop_table) td {
    background: #333333 !important;
    color: #ffffff !important;
}

.wad-dashboard-wrapper table:not(.woocommerce-table):not(.shop_table) tr:nth-child(even) td {
    background: #2a2a2a !important;
}

.wad-dashboard-wrapper table:not(.woocommerce-table):not(.shop_table) tr:hover td {
    background: #3c3c3c !important;
}
/* ============================================
   FIX: FORCE WHITE TEXT FOR CUSTOM CTA, ONBOARDING & FLOATING BUTTONS
============================================ */

/* Target the CTA and Onboarding buttons */
.wad-cta-btn.wad-cta-primary,
.wad-cta-btn.wad-cta-primary *,
.wad-onboarding-btn-primary,
.wad-onboarding-btn-primary * {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Target the Floating Add Product button */
.wad-floating-add-product,
.wad-floating-add-product * {
    color: #ffffff !important;
    text-decoration: none !important;
}