/**
 * Sunny HQ My Account Styles
 *
 * Custom styling for WooCommerce My Account pages
 * Brand colors: Navy #020051, Coral #FF6048
 *
 * @package SunnyHQ
 */

/* ============================================
   KILL ALL ANIMATIONS - Must be first
   ============================================ */
.shq-woocommerce-page,
.shq-woocommerce-page *,
.shq-woocommerce-page *::before,
.shq-woocommerce-page *::after {
    animation: none !important;
}

/* ============================================
   LOGO FIX - Force correct size on My Account
   ============================================ */
.page-my-account .nav-logo img,
.page-my-account .nav-logo-dark,
.page-my-account .nav-logo-light {
    max-height: 32px !important;
    width: auto !important;
    height: 32px !important;
    max-width: 160px !important;
}

.page-my-account .nav-wrapper {
    overflow: hidden !important;
}

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --shq-navy: #020051;
    --shq-coral: #FF6048;
    --shq-purple: #6248FF;
    --shq-text: #333;
    --shq-text-light: #666;
    --shq-border: #e5e7eb;
    --shq-bg-light: #f4f4f8;
    --shq-white: #fff;
    --shq-shadow: 0 2px 12px rgba(2, 0, 81, 0.08);
    --shq-shadow-hover: 0 4px 20px rgba(2, 0, 81, 0.12);
    --shq-radius: 12px;
    --shq-radius-sm: 8px;
}

/* ============================================
   NAV FIX - Force solid nav state on WooCommerce pages
   ============================================ */
/* Force nav into scrolled/solid state */
.shq-inner-page .nav-wrapper {
    padding: 10px 24px 0;
}

.shq-inner-page .nav-wrapper .nav-bar {
    border-radius: 16px;
    background: rgba(30, 40, 120, 0.85);
}

.shq-inner-page .nav-wrapper .nav-bar::after {
    opacity: 1;
}

/* Hide any hero decorations/swooshes */
.shq-inner-page .hero-arcs,
.shq-inner-page .hero-gradient,
.shq-inner-page .hero-swoosh,
.shq-inner-page .hero,
.shq-inner-page .page-hero,
.shq-inner-page .page-hero-arcs,
.shq-woocommerce-page .hero-arcs,
.shq-woocommerce-page .hero-gradient,
.shq-woocommerce-page .hero-swoosh,
.shq-woocommerce-page .hero,
.shq-woocommerce-page .page-hero,
.shq-woocommerce-page .page-hero-arcs {
    display: none !important;
}

/* Remove any body/main pseudo-element decorations */
.shq-woocommerce-page::before,
.shq-woocommerce-page::after,
.shq-woocommerce-page main::before,
.shq-woocommerce-page main::after,
.shq-woocommerce-page .site-main::before,
.shq-woocommerce-page .site-main::after {
    display: none !important;
    content: none !important;
}

/* BRUTE FORCE: Kill ALL potential swoosh pseudo-elements */
.shq-woocommerce-page .nav-wrapper::before,
.shq-woocommerce-page .nav-wrapper::after,
.shq-woocommerce-page .nav-bar::before,
.shq-woocommerce-page #page::before,
.shq-woocommerce-page #page::after,
.shq-woocommerce-page .site::before,
.shq-woocommerce-page .site::after,
.shq-woocommerce-page .shq-myaccount-main::before,
.shq-woocommerce-page .shq-myaccount-main::after,
.shq-woocommerce-page .shq-myaccount-container::before,
.shq-woocommerce-page .shq-myaccount-container::after {
    display: none !important;
    content: none !important;
    background: none !important;
}

/* Nuclear option: Kill background-image on any pseudo-element
   EXCEPT specific elements we need (buttons, checkmarks, etc.) */
.shq-woocommerce-page .nav-wrapper *::before,
.shq-woocommerce-page .nav-wrapper *::after,
.shq-woocommerce-page main > *::before,
.shq-woocommerce-page main > *::after {
    background-image: none !important;
}

/* Re-enable specific pseudo-elements we need */
.shq-woocommerce-page .woocommerce-MyAccount-navigation ul li.is-active a::before,
.shq-woocommerce-page .shq-btn::before,
.shq-woocommerce-page .shq-btn::after,
.shq-woocommerce-page .button::before,
.shq-woocommerce-page .button::after {
    background-image: unset;
}

/* Ensure white background */
.shq-woocommerce-page,
.shq-woocommerce-page body,
.shq-woocommerce-page main,
.shq-woocommerce-page .site-main {
    background: #fff !important;
}

/* ============================================
   PAGE WRAPPER
   ============================================ */
.shq-woocommerce-page {
    background: var(--shq-white);
}

.shq-myaccount-main {
    padding-top: 140px; /* Account for fixed nav + extra space */
    min-height: calc(100vh - 400px);
}

.shq-myaccount-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

/* ============================================
   WOOCOMMERCE MY ACCOUNT LAYOUT
   ============================================ */
.woocommerce-account .woocommerce {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.woocommerce-MyAccount-navigation {
    flex: 0 0 250px;
    background: var(--shq-white);
    border-radius: var(--shq-radius);
    box-shadow: var(--shq-shadow);
    padding: 0.75rem;
    position: sticky;
    top: 140px;
}

.woocommerce-MyAccount-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .woocommerce-account .woocommerce {
        flex-direction: column;
        gap: 1.5rem;
    }

    .woocommerce-MyAccount-navigation {
        flex: none;
        width: 100%;
        position: static;
    }

    .shq-myaccount-main {
        padding-top: 100px;
    }

    .shq-myaccount-container {
        padding: 1.5rem 1rem 3rem;
    }
}

/* ============================================
   NAVIGATION SIDEBAR
   ============================================ */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-MyAccount-navigation ul li {
    margin: 0;
}

.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 0.875rem 1.25rem;
    color: var(--shq-text);
    text-decoration: none;
    border-radius: var(--shq-radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background: var(--shq-bg-light);
    color: var(--shq-navy);
}

.woocommerce-MyAccount-navigation ul li.is-active a {
    background: var(--shq-navy);
    color: var(--shq-white);
}

.woocommerce-MyAccount-navigation ul li.is-active a:hover {
    background: var(--shq-navy);
    color: var(--shq-white);
}

/* Log out link */
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: var(--shq-text-light);
}

.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    color: var(--shq-coral);
    background: #fff5f3;
}

/* ============================================
   HIDE DEFAULT DASHBOARD TEXT
   ============================================ */
.woocommerce-MyAccount-content > p:first-child,
.woocommerce-MyAccount-content > p:first-of-type {
    display: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--shq-navy);
    margin-bottom: 1.5rem;
}

/* ============================================
   CUSTOM DASHBOARD
   ============================================ */
.shq-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.shq-dashboard-greeting h2 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--shq-navy);
    margin: 0 0 0.5rem;
}

/* Dashboard Cards */
.shq-dashboard-card {
    background: var(--shq-white);
    border-radius: var(--shq-radius);
    box-shadow: var(--shq-shadow);
    overflow: hidden;
}

.shq-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--shq-border);
    background: var(--shq-bg-light);
}

.shq-card-header h3 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.125rem;
    color: var(--shq-navy);
    margin: 0;
}

.shq-card-body {
    padding: 1.5rem;
}

.shq-card-actions {
    padding: 1.5rem;
    background: var(--shq-bg-light);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Status badges */
.shq-status {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shq-status-active {
    background: #d4edda;
    color: #155724;
}

.shq-status-on-hold {
    background: #fff3cd;
    color: #856404;
}

.shq-status-pending-cancel {
    background: #fff3cd;
    color: #856404;
}

.shq-status-cancelled,
.shq-status-expired {
    background: #f8d7da;
    color: #721c24;
}

/* Plan info */
.shq-plan-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shq-plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shq-navy);
    font-family: 'Source Serif 4', Georgia, serif;
}

.shq-plan-price {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--shq-text);
}

.shq-billing-period {
    font-weight: 400;
    color: var(--shq-text-light);
}

.shq-next-payment {
    margin-top: 0.5rem;
    color: var(--shq-text-light);
    font-size: 0.9375rem;
}

.shq-next-payment .shq-label {
    margin-right: 0.5rem;
}

.shq-next-payment .shq-value {
    font-weight: 600;
    color: var(--shq-text);
}

/* No subscription state */
.shq-no-subscription .shq-card-body {
    text-align: center;
    padding: 3rem 2rem;
}

.shq-no-subscription h3 {
    margin-bottom: 0.5rem;
}

.shq-no-subscription p {
    color: var(--shq-text-light);
    margin-bottom: 1.5rem;
}

/* Quick links */
.shq-dashboard-quick-links {
    background: var(--shq-white);
    border-radius: var(--shq-radius);
    box-shadow: var(--shq-shadow);
    padding: 1.5rem;
}

.shq-dashboard-quick-links h4 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1rem;
    color: var(--shq-navy);
    margin: 0 0 1rem;
}

.shq-dashboard-quick-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.shq-dashboard-quick-links li {
    margin: 0;
}

.shq-dashboard-quick-links a {
    display: block;
    padding: 0.75rem 0;
    color: var(--shq-text);
    text-decoration: none;
    border-bottom: 1px solid var(--shq-border);
    font-family: 'DM Sans', sans-serif;
    transition: color 0.2s ease;
}

.shq-dashboard-quick-links li:last-child a {
    border-bottom: none;
}

.shq-dashboard-quick-links a:hover {
    color: var(--shq-coral);
}

/* ============================================
   BUTTONS
   ============================================ */
.shq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 999px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.shq-btn-primary {
    background: var(--shq-coral);
    color: var(--shq-white);
}

.shq-btn-primary:hover {
    background: #e55540;
    color: var(--shq-white);
    transform: translateY(-2px);
    box-shadow: var(--shq-shadow-hover);
}

.shq-btn-secondary {
    background: transparent;
    color: var(--shq-navy);
    border: 2px solid var(--shq-navy);
}

.shq-btn-secondary:hover {
    background: var(--shq-navy);
    color: var(--shq-white);
}

/* Primary CTA - Update Payment Method - MOST PROMINENT */
.shq-btn-update-payment {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(255, 96, 72, 0.3);
}

.shq-btn-update-payment:hover {
    box-shadow: 0 6px 20px rgba(255, 96, 72, 0.4);
}

/* ============================================
   WOOCOMMERCE FORMS & TABLES
   ============================================ */
/* WooCommerce default buttons */
.woocommerce-MyAccount-content .woocommerce-Button,
.woocommerce-MyAccount-content .button,
.woocommerce-MyAccount-content button[type="submit"] {
    background: var(--shq-coral) !important;
    color: var(--shq-white) !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 0.875rem 1.75rem !important;
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    transition: all 0.2s ease !important;
}

.woocommerce-MyAccount-content .woocommerce-Button:hover,
.woocommerce-MyAccount-content .button:hover,
.woocommerce-MyAccount-content button[type="submit"]:hover {
    background: #e55540 !important;
    transform: translateY(-2px);
    box-shadow: var(--shq-shadow-hover);
}

/* Form inputs */
.woocommerce-MyAccount-content input[type="text"],
.woocommerce-MyAccount-content input[type="email"],
.woocommerce-MyAccount-content input[type="password"],
.woocommerce-MyAccount-content input[type="tel"],
.woocommerce-MyAccount-content select,
.woocommerce-MyAccount-content textarea {
    border: 1px solid var(--shq-border);
    border-radius: var(--shq-radius-sm);
    padding: 0.75rem 1rem;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.woocommerce-MyAccount-content input:focus,
.woocommerce-MyAccount-content select:focus,
.woocommerce-MyAccount-content textarea:focus {
    outline: none;
    border-color: var(--shq-purple);
    box-shadow: 0 0 0 3px rgba(98, 72, 255, 0.1);
}

/* Form labels */
.woocommerce-MyAccount-content label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--shq-navy);
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================================
   PAYMENT METHODS PAGE
   ============================================ */
.woocommerce-PaymentMethods {
    background: var(--shq-white);
    border-radius: var(--shq-radius);
    box-shadow: var(--shq-shadow);
    overflow: hidden;
}

.woocommerce-PaymentMethod {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--shq-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.woocommerce-PaymentMethod:last-child {
    border-bottom: none;
}

/* Make "Change payment" buttons prominent */
.woocommerce-orders-table__cell-order-actions a.change_payment_method,
.subscription_details a.change_payment_method,
a.change_payment_method,
.woocommerce-MyAccount-content a[href*="change_payment_method"] {
    background: var(--shq-coral) !important;
    color: var(--shq-white) !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 999px !important;
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 14px rgba(255, 96, 72, 0.3) !important;
}

a.change_payment_method:hover,
.woocommerce-MyAccount-content a[href*="change_payment_method"]:hover {
    background: #e55540 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 96, 72, 0.4) !important;
}

/* ============================================
   SUBSCRIPTION PAGE
   ============================================ */
.woocommerce-table--order-details,
.shop_table {
    width: 100%;
    border-collapse: collapse;
    background: var(--shq-white);
    border-radius: var(--shq-radius);
    box-shadow: var(--shq-shadow);
    overflow: hidden;
}

.woocommerce-table--order-details th,
.woocommerce-table--order-details td,
.shop_table th,
.shop_table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--shq-border);
    font-family: 'DM Sans', sans-serif;
}

.woocommerce-table--order-details thead th,
.shop_table thead th {
    background: var(--shq-bg-light);
    font-weight: 600;
    color: var(--shq-navy);
}

.woocommerce-table--order-details tbody tr:last-child td,
.shop_table tbody tr:last-child td {
    border-bottom: none;
}

/* Subscription details table */
.subscription_details {
    background: var(--shq-white);
    border-radius: var(--shq-radius);
    box-shadow: var(--shq-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.subscription_details tr {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--shq-border);
}

.subscription_details tr:last-child {
    border-bottom: none;
}

.subscription_details td {
    padding: 0;
    border: none;
}

/* ============================================
   NOTICES & MESSAGES
   ============================================ */
.woocommerce-account .woocommerce-message,
.woocommerce-account .woocommerce-info {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--shq-radius-sm);
    font-family: 'DM Sans', sans-serif;
}

.woocommerce-account .woocommerce-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--shq-radius-sm);
    font-family: 'DM Sans', sans-serif;
}

.woocommerce-account .woocommerce-error li,
.woocommerce-account .woocommerce-message li,
.woocommerce-account .woocommerce-info li {
    list-style: none;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .shq-dashboard-greeting h2 {
        font-size: 1.5rem;
    }

    .shq-card-actions {
        flex-direction: column;
    }

    .shq-btn {
        width: 100%;
        text-align: center;
    }

    .woocommerce-PaymentMethod {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .subscription_details tr {
        flex-direction: column;
        gap: 0.25rem;
    }

    .shq-plan-name {
        font-size: 1.25rem;
    }
}
