/**
 * Silva Customer Portal - Modern, Accessible Dashboard
 * 
 * Design Principles:
 * - Modern SaaS-style interface (Stripe/Notion aesthetic)
 * - 16px base font size with responsive scaling
 * - 44px minimum touch targets (WCAG AA compliant)
 * - 4.5:1 color contrast ratios (WCAG AA)
 * - Clean, professional design with subtle shadows
 * - Focus indicators for keyboard navigation
 * - Reduced motion support
 * - Fully responsive mobile-first design
 * 
 * @package Silva_Customer_Portal
 * @version 2.0.0
 * 
 * ARCHITECTURE:
 * Modular CSS files are enqueued via WordPress in class-plugin.php.
 * Each module handles a specific concern:
 * 
 * - variables.css:   Design tokens (colors, spacing, typography)
 * - base.css:        Resets, utilities, animations
 * - layout.css:      Header, navigation, content structure
 * - components.css:  Buttons, cards, badges, filters
 * - overlays.css:    Modals, toasts, alerts, loading states
 * - features.css:    Property-centric components (Week 1)
 * - desktop.css:     Desktop optimizations (1025px+)
 * - responsive.css:  Mobile optimizations & breakpoints
 * 
 * NOTE: @import statements removed for WordPress compatibility.
 * All CSS files are properly enqueued with dependencies in class-plugin.php.
 */

:root {
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --border-color: #e5e7eb;
    --bg-gray: #f9fafb;
    --bg-white: #ffffff;
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Typography - Modern sizing */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    
    /* Touch Targets - WCAG AA Compliant */
    --touch-target-min: 44px;
    --button-padding: 12px 24px;
    
    /* Focus */
    --focus-outline: 2px solid #667eea;
    --focus-offset: 2px;
    
    /* Transitions */
    --transition-speed: 0.15s;
    
    /* Shadows - 2025 Modern depth system (softer) */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

.silva-customer-dashboard {
    position: relative; /* Container for absolutely positioned skip link */
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-gray);
    padding: 0;
    margin: 0;
    max-width: 100%;
    /* min-height: 100vh removed - causes iOS Safari issues */
}

.silva-customer-dashboard *,
.silva-customer-dashboard *::before,
.silva-customer-dashboard *::after {
    box-sizing: border-box;
}

/* Remove WordPress theme padding from content wrappers */
body:has(.silva-customer-dashboard) .site-content,
body:has(.silva-customer-dashboard) #content,
body:has(.silva-customer-dashboard) .content-area,
body:has(.silva-customer-dashboard) main:not(.dashboard-content),
body:has(.silva-customer-dashboard) .main-content,
.silva-customer-dashboard-page .site-content,
.silva-customer-dashboard-page #content,
.silva-customer-dashboard-page .content-area,
.silva-customer-dashboard-page main:not(.dashboard-content),
.silva-customer-dashboard-page .main-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Override theme's .site-content padding more aggressively */
.silva-customer-dashboard,
.silva-customer-dashboard ~ *,
.silva-customer-dashboard + * {
    padding-top: 0 !important;
}

/* Ensure parent containers of dashboard don't add spacing */
.entry-content:has(.silva-customer-dashboard),
.site-main:has(.silva-customer-dashboard),
article:has(.silva-customer-dashboard) {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Remove theme container constraints */
body.silva-dashboard-page .container,
body.silva-dashboard-page .site-inner,
body.silva-dashboard-page .entry-content {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* ============================================
   SKIP LINK (Accessibility)
   ============================================ */

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: var(--spacing-md);
    text-decoration: none;
    font-weight: 600;
    z-index: var(--z-dropdown);
}

.skip-link:focus {
    top: 0;
    outline: var(--focus-outline);
outline-offset: var(--focus-offset);

/* ============================================
   NAVIGATION TABS
   ============================================ */
/* Navigation styles moved to layout.css - import handles this */

/* ============================================
   CONTENT AREA
   ============================================ */
    outline-offset: var(--focus-offset);
}

.tab-icon {
    font-size: 18px;
}

.tab-label {
    font-size: var(--font-size-sm);
}

/* ============================================
   CONTENT LAYOUT SYSTEM
   ============================================ */

/* Base content area - no padding by default */
.dashboard-content {
    background: transparent;
    margin: 0;
    padding: 0;
    min-height: 300px;
}

/* Services tab - ensure zero padding/margin */
.dashboard-content:has(.silva-customer-services) {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

/* Container for padded content (Projects, Messages, Settings) */
.dashboard-content__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Full-width modifier for edge-to-edge pages (Services, Marketplace) */
.dashboard-content--fullwidth {
    padding: 0;
    margin: 0;
    max-width: none;
}

/* Tab panel wrapper */
.tab-panel {
    padding: 0;
    margin: 0;
    animation: fadeIn 0.2s ease-in; /* Animation defined in base.css */
}

/* Services tab - ensure zero padding/margin */
.tab-panel:has(.silva-customer-services) {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

.tab-panel[hidden] {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-content__container {
        padding: 16px;
    }
    
    /* Override fullwidth zero padding on mobile to make room for fixed bottom nav */
    .dashboard-content--fullwidth {
        padding-bottom: 100px !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .tab-panel {
        animation: none;
    }
    .nav-tab,
    .btn-support {
        transition: none;
    }
}

/* ============================================
   SECTION HEADERS
   ============================================ */

.section-heading {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
}

.section-description {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-xs) 0;
}

.subsection-heading {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
}

/* ============================================
   STATUS CARDS (Overview)
   ============================================ */

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.status-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: var(--spacing-xs);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-xs);
}

.status-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-blue-light);
}

.status-card-highlight {
    border-color: var(--warning-yellow);
    background: var(--warning-light);
}

.card-icon {
    font-size: 18px;
    line-height: 1;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
    line-height: 1;
}

.card-value-money {
    color: var(--success-green);
}

.card-description {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    margin: 0;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    min-height: var(--touch-target-min);
    padding: var(--button-padding);
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-family);
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-speed);
}

.btn:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

.btn-primary {
    background: #014385 !important; /* Flat modern color, no gradient */
    color: #ffffff !important;
    border-radius: 14px; /* Modern rounded corners */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: #012f6b !important; /* Darker on hover */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: transparent;
    color: #014385;
    border: 1px solid #d0d7e2;
}

.btn-secondary:hover {
    background: #f3f7ff;
    border-color: #014385;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-danger {
    background: var(--danger-red);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   ESTIMATE/JOB/INVOICE CARDS
   ============================================ */

.estimates-list,
.jobs-list,
.invoices-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.project-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-blue);
    border-radius: 8px;
    padding: var(--spacing-lg);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-left-color: var(--primary-blue-dark);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.project-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.project-number {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    margin: 0;
}

.card-body {
    margin-bottom: var(--spacing-md);
}

.card-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
}

.card-row:last-child {
    border-bottom: none;
}

.card-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.card-value-text {
    color: var(--text-primary);
}

.card-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: 12px;
    background: var(--bg-gray);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-pending {
    background: var(--warning-light);
    color: #92400e;
}

.status-badge.status-sent {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-approved {
    background: var(--success-light);
    color: #065f46;
}

.status-badge.status-in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-completed {
    background: var(--success-light);
    color: #065f46;
}

.status-badge.status-paid {
    background: var(--success-light);
    color: #065f46;
}

.status-badge.status-overdue {
    background: var(--danger-light);
    color: #991b1b;
}

/* ============================================
   FILTER BUTTONS
   ============================================ */

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-heading {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
}

.empty-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-lg) 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ============================================
   MODALS
   ============================================ */

.silva-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.silva-modal.is-open {
    display: flex;
}

.silva-modal[hidden] {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    z-index: var(--z-modal);
}

.modal-container-small {
    max-width: 500px;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-icon {
    font-size: 32px;
    margin-right: var(--spacing-sm);
}

.modal-close {
    min-width: 40px;
    min-height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-gray);
    border-color: var(--text-secondary);
}

.modal-close:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 2px;
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: var(--z-loading);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay[hidden] {
    display: none;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite; /* Animation defined in base.css */
    margin: 0 auto var(--spacing-md);
}

.loading-text {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-secondary);
}

.loading-skeleton {
    display: inline-block;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite; /* Animation defined in base.css */
    border-radius: 4px;
}

.loading-skeleton-block {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-card {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
    margin-bottom: var(--spacing-lg);
}

.skeleton-photo {
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ============================================
   ALERTS
   ============================================ */

.balance-alert {
    background: var(--warning-light);
    border: 1px solid var(--warning-yellow);
    border-left: 4px solid var(--warning-yellow);
    border-radius: 8px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert-heading {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.alert-text {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin: 0;
}

/* ============================================
   HELP SECTION
   ============================================ */

.help-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--spacing-md);
}

.help-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-xs);
}

.help-card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0 0 var(--spacing-xs) 0;
}

.help-card p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-md) 0;
}

/* ============================================
   PHOTO GALLERY
   ============================================ */

.photos-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.photo-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-sm);
}

.photo-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   ACTIONS & ACTIVITY LISTS
   ============================================ */

.next-actions-section,
.recent-activity-section {
    margin-bottom: var(--spacing-xl);
}

.actions-list,
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.action-item,
.activity-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-blue);
    border-radius: 8px;
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all var(--transition-speed);
}

.action-item:hover,
.activity-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.action-item.priority-high {
    border-left-color: var(--danger-red);
    background: var(--danger-light);
}

.action-item.priority-medium {
    border-left-color: var(--warning-yellow);
}

/* Outstanding Balance Card - Compact Centered Layout */
.outstanding-balance-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 16px !important;
    gap: 10px !important;
}

.outstanding-balance-card .action-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.outstanding-balance-card .action-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.outstanding-balance-card .action-description {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.outstanding-balance-card .btn {
    margin: 0;
}

/* Upcoming Visit Card - Brand Blue Design */
.upcoming-visit-card {
    background: #f3f7ff;
    border-left: 4px solid #014385;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.upcoming-visit-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.visit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.visit-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.visit-icon {
    font-size: 18px;
}

.visit-badge {
    background: #e8f0ff;
    color: #014385;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.visit-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.visit-type {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.visit-datetime {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.visit-action {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #014385;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.visit-action:hover {
    color: #012951;
    transform: translateX(4px);
}

.action-icon,
.activity-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.action-content,
.activity-content {
    flex: 1;
}

.action-title,
.activity-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.action-description,
.activity-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
}

.action-time,
.activity-time {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .silva-customer-dashboard {
        font-size: var(--font-size-sm);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: var(--spacing-xs);
    }
    
    .dashboard-title {
        font-size: var(--font-size-base);
    }
    
    .dashboard-subtitle {
        font-size: 10px;
    }
    
    .btn-support {
        width: 100%;
        justify-content: center;
        min-height: 36px;
        padding: 6px 12px;
        font-size: var(--font-size-xs);
    }
    
    .dashboard-nav {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0;
        right: 0;
        padding: 0;
        margin-bottom: 0;
        justify-content: space-evenly;
        border-top: 1px solid var(--border-color);
        border-bottom: none;
        background: var(--bg-white);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
        z-index: var(--z-sticky);
        overflow-x: visible;
    }
    
    .nav-tab {
        flex: 1;
        max-width: 80px;
        font-size: 10px;
        padding: 10px 4px 8px;
        min-height: 56px;
        flex-direction: column;
        gap: 2px;
    }
    
    .tab-icon {
        font-size: 24px;
    }
    
    .tab-label {
        display: none;
    }
    
    .dashboard-content {
        padding: var(--spacing-xs);
        padding-bottom: calc(100px + env(safe-area-inset-bottom)); /* Increased padding for fixed bottom navigation bar + iOS safe area */
    }
    
    .status-cards {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }
    
    .status-card {
        padding: var(--spacing-xs);
    }
    
    .card-icon {
        font-size: 16px;
    }
    
    .card-value {
        font-size: var(--font-size-base);
    }
    
    .project-card {
        padding: var(--spacing-sm);
    }
    
    .card-header {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        width: 100%;
    }
    
    .modal-container {
        max-width: 100%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--spacing-sm);
    }
    
    .modal-footer {
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .photos-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    /* Upcoming Visit Card - Mobile Optimization */
    .upcoming-visit-card {
        padding: 12px 14px;
    }
    
    .visit-title {
        font-size: 14px;
    }
    
    .visit-icon {
        font-size: 16px;
    }
    
    .visit-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .visit-type {
        font-size: 13px;
    }
    
    .visit-datetime {
        font-size: 12px;
    }
    
    .visit-action {
        font-size: 12px;
    }

}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
    
    .nav-tab,
    .btn,
    .project-card {
        border-width: 3px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .dashboard-nav,
    .btn-support,
    .card-actions,
    .loading-overlay,
    .silva-modal {
        display: none !important;
    }
    
    .silva-customer-dashboard {
        background: white;
        padding: 0;
    }
    
    .project-card {
        page-break-inside: avoid;
        border: 2px solid #000;
        margin-bottom: 20px;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
/* Toast styles moved to ux-enhancements.css - import handles this */

/* ============================================
   UTILITY CLASSES
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}



/* ============================================
   PROPERTY-CENTRIC COMPONENTS (Week 1)
   ============================================ */

/* Property Badge in Header */
.property-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.property-icon {
    font-size: 28px;
    line-height: 1;
}

.property-info {
    flex: 1;
}

/* Property Summary Card */
.property-summary-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    border-radius: 4px;
    padding: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    color: white;
    box-shadow: var(--shadow-sm);
}

.property-header {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.property-photo {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.property-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.property-details {
    flex: 1;
}

.property-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: white;
    margin: 0 0 2px 0;
}

.property-meta {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.property-separator {
    margin: 0 var(--spacing-xs);
}

/* Lifetime Investment Card */
.lifetime-investment-card {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    border-radius: 4px;
    padding: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.investment-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.investment-content {
    flex: 1;
}

.investment-content h3 {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.investment-amount {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.investment-meta {
    display: flex;
    gap: var(--spacing-sm);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
}

.investment-meta span {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Invoices Summary Container */
.invoices-summary {
    margin-bottom: var(--spacing-xs);
}

/* Explore Tab Iframe */
.explore-iframe-container {
    width: 100%;
    height: calc(100vh - 180px);
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.explore-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .explore-iframe-container {
        height: calc(100vh - 160px);
        border-radius: 0;
    }
}

/* Mobile Responsive for Property Components */
@media (max-width: 768px) {
    .property-summary-card {
        padding: var(--spacing-xs);
    }
    
    .property-header {
        flex-direction: row;
        text-align: left;
        gap: var(--spacing-xs);
    }
    
    .property-photo {
        width: 40px;
        height: 40px;
    }
    
    .property-placeholder {
        font-size: 20px;
    }
    
    .property-title {
        font-size: var(--font-size-xs);
    }
    
    .property-meta {
        font-size: 9px;
    }
    
    .lifetime-investment-card {
        flex-direction: row;
        text-align: left;
        padding: var(--spacing-xs);
        gap: var(--spacing-xs);
    }
    
    .investment-icon {
        font-size: 20px;
    }
    
    .investment-amount {
        font-size: var(--font-size-base);
    }
    
    .investment-content h3 {
        font-size: 8px;
    }
    
    .investment-meta {
        flex-direction: row;
        gap: var(--spacing-xs);
        align-items: flex-start;
        font-size: 9px;
    }
}

/* ============================================================================
   FOOTER REMOVAL FOR DASHBOARD PAGES
   ============================================================================ */

/**
 * Hide WordPress theme footer on customer dashboard pages to prevent
 * unnecessary scrolling. Targets multiple common footer selectors to ensure
 * compatibility with various themes.
 * 
 * Uses two strategies:
 * 1. Body class targeting (when body class filter works)
 * 2. Content-based targeting (when page has .silva-customer-dashboard)
 */
body.silva-customer-dashboard-page footer,
body.silva-customer-dashboard-page .footer,
body.silva-customer-dashboard-page .site-footer,
body.silva-customer-dashboard-page #footer,
body.silva-customer-dashboard-page #colophon,
body.silva-customer-dashboard-page .footer-wrapper,
body:has(.silva-customer-dashboard) footer,
body:has(.silva-customer-dashboard) .footer,
body:has(.silva-customer-dashboard) .site-footer,
body:has(.silva-customer-dashboard) #footer,
body:has(.silva-customer-dashboard) #colophon,
body:has(.silva-customer-dashboard) .footer-wrapper {
    display: none !important;
    visibility: hidden !important;
}

/**
 * Remove bottom padding/margin from site wrappers to eliminate whitespace
 * that would appear after hiding the footer.
 */
body.silva-customer-dashboard-page .site-wrapper,
body.silva-customer-dashboard-page #page,
body.silva-customer-dashboard-page .site,
body.silva-customer-dashboard-page .content-wrapper,
body:has(.silva-customer-dashboard) .site-wrapper,
body:has(.silva-customer-dashboard) #page,
body:has(.silva-customer-dashboard) .site,
body:has(.silva-customer-dashboard) .content-wrapper {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
