/* ===================================
   COMPONENTS - Modern 2026 Design
   Portfolio-specific components
   =================================== */

/* Service Cards */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

sl-card.service-card {
    height: 100%;
    --border-radius: 16px;
    --border-color: rgba(0, 0, 0, 0.06);
}

sl-card.service-card::part(base) {
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

sl-card.service-card::part(base):hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

sl-card.service-card::part(body) {
    flex: 1;
    padding: 2rem;
}

sl-card.service-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #0f172a;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

sl-card.service-card h3 sl-icon {
    font-size: 1.75rem;
    color: #2563eb;
}

sl-card.service-card p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

sl-card.service-card ul {
    color: #64748b;
    line-height: 1.8;
    padding-left: 1.5rem;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

sl-card.portfolio-card {
    --border-radius: 16px;
    --border-color: rgba(0, 0, 0, 0.06);
}

sl-card.portfolio-card::part(base) {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

sl-card.portfolio-card::part(base):hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

sl-card.portfolio-card::part(body) {
    flex: 1;
    padding: 1.75rem;
}

sl-card.portfolio-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

sl-card.portfolio-card strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    display: block;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

sl-card.portfolio-card p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.portfolio-card .tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.contact-form sl-input,
.contact-form sl-textarea {
    margin-bottom: 1.75rem;
}

/* Skills Container */
.skills-container {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .service-cards,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 2rem 1.5rem;
    }
}

/* ============================================
   AUDIT RESULTS PAGE STYLES
   ============================================ */

/* Executive Summary Card */
.audit-summary-card {
    border: 2px solid var(--sl-color-primary-600);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--sl-color-primary-600);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}

.stat-value.stat-error {
    color: var(--sl-color-danger-600);
}

.stat-value.stat-warning {
    color: var(--sl-color-warning-600);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

/* Score Cards */
.score-card {
    text-align: center;
}

.score-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}

.score-good { color: var(--sl-color-success-600); }
.score-warning { color: var(--sl-color-warning-600); }
.score-poor { color: var(--sl-color-danger-600); }

.score-label {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Core Web Vitals */
.cwv-metric {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cwv-metric:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cwv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.cwv-header h3 {
    margin-bottom: 0.25rem;
}

.metric-value {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Issue Grid */
.issue-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.issue-grid sl-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.issue-grid sl-card p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.issue-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.impact-text {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* Passed Audit Cards */
.passed-audit-card {
    display: flex;
    align-items: center;
    padding: 1rem !important;
}

.passed-audit-card::part(base) {
    padding: 1rem;
}

/* Responsive Adjustments for Audit Results */
@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 1.5rem;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .score-value {
        font-size: 2rem;
    }

    .cwv-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   Business Search Components
   ======================================== */

/* Business Search Result Cards */
.search-result-card {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.search-result-card:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

/* Preview Card (matches lead info card from audit-results.html) */
.preview-card-selected {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* No Website Warning */
.no-website-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #92400e;
}

/* Loading Spinner Container */
.loading-spinner {
    text-align: center;
    padding: 1.5rem;
    color: #64748b;
}

/* ============================================================================
   UTILITY CLASSES - Headings, Icons, Spacing
   ============================================================================ */

/* --- Heading Utilities --- */

/* Page-level headings (H1) */
.h1-page {
    font-size: 2rem;           /* 32px */
    margin: 0 0 1.5rem 0;      /* Consistent bottom spacing */
    font-weight: 700;
    color: var(--color-text, #0f172a);
}

.h1-page-tight {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;      /* Tighter spacing variant */
    font-weight: 700;
    color: var(--color-text, #0f172a);
}

/* Section headings (H2) */
.h2-section {
    font-size: 1.5rem;         /* 24px - standardized */
    margin: 0;                 /* Reset for card headers */
    font-weight: 600;
    color: var(--color-text, #0f172a);
}

.h2-section-spaced {
    font-size: 1.5rem;
    margin: 0 0 1rem 0;        /* With bottom margin */
    font-weight: 600;
}

/* Card/subsection headings (H3) */
.h3-card {
    font-size: 1.25rem;        /* 20px */
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: var(--color-text, #1e293b);
}

.h3-chart {
    font-size: 1.125rem;       /* 18px - for chart titles */
    margin: 0 0 1rem 0;
    font-weight: 600;
}

/* --- Icon Size Utilities --- */

.icon-sm {
    font-size: 0.875rem;       /* 14px - inline status icons */
}

.icon-md {
    font-size: 1rem;           /* 16px - standard inline */
}

.icon-lg {
    font-size: 1.25rem;        /* 20px - info/alert icons */
}

.icon-xl {
    font-size: 3rem;           /* 48px - stat cards */
    margin-bottom: 0.5rem;
}

.icon-empty-state {
    font-size: 4rem;           /* 64px - standardized for empty states */
    margin-bottom: 1rem;
    color: #94a3b8;            /* Muted gray */
}

/* --- Spacing Utilities --- */

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }   /* 8px */
.mb-2 { margin-bottom: 1rem; }     /* 16px */
.mb-3 { margin-bottom: 1.5rem; }   /* 24px */
.mb-4 { margin-bottom: 2rem; }     /* 32px */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.gap-sm { gap: 0.5rem; }           /* 8px */
.gap-md { gap: 0.75rem; }          /* 12px */
.gap-lg { gap: 1rem; }             /* 16px */

/* --- Button Icon Spacing Fix --- */

sl-button::part(base) {
    gap: 0.5rem;  /* Add spacing between icon and text in all buttons */
}

/* Specific spacing for prefix/suffix icons */
sl-button sl-icon[slot="prefix"] {
    margin-right: 0.25rem;
}

sl-button sl-icon[slot="suffix"] {
    margin-left: 0.25rem;
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS & UTILITIES
   ============================================================================ */

/* --- Breakpoint Variables (for reference) --- */
/*
   480px  - Small phones (iPhone SE)
   768px  - Tablet portrait / large phones
   1024px - Tablet landscape / small desktop
*/

/* --- Responsive Visibility Utilities --- */

@media (max-width: 767px) {
    .hidden-mobile { display: none !important; }
}

@media (min-width: 768px) {
    .mobile-only { display: none !important; }
}

@media (max-width: 1023px) {
    .hidden-tablet { display: none !important; }
}

@media (min-width: 1024px) {
    .tablet-only { display: none !important; }
    .mobile-only { display: none !important; }
}

/* --- Responsive Text Alignment --- */

@media (max-width: 767px) {
    .text-mobile-center { text-align: center !important; }
    .text-mobile-left { text-align: left !important; }
}

/* --- Responsive Spacing Overrides --- */

@media (max-width: 767px) {
    .mb-mobile-0 { margin-bottom: 0 !important; }
    .mb-mobile-1 { margin-bottom: 0.5rem !important; }
    .mb-mobile-2 { margin-bottom: 1rem !important; }

    .p-mobile-1 { padding: 0.5rem !important; }
    .p-mobile-2 { padding: 1rem !important; }
}

/* --- Touch-Friendly Sizing --- */

@media (max-width: 767px) {
    /* Minimum touch target size for mobile */
    sl-button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger clickable areas for links */
    a {
        padding: 0.25rem;
        margin: -0.25rem;
    }
}

/* --- Responsive Container Padding --- */

@media (max-width: 767px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* ============================================================================
   RESPONSIVE TABLE PATTERNS
   ============================================================================ */

/* --- Table Scroll Wrapper --- */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    position: relative; /* Enable positioned ::after pseudo-element */
}

@media (max-width: 767px) {
    .table-responsive {
        border: 1px solid #e2e8f0;
        border-radius: 6px;
    }

    /* Add scroll indicator shadow */
    .table-responsive::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to left, rgba(0,0,0,0.05), transparent);
        pointer-events: none;
    }
}

/* --- Mobile Card Alternative (Optional) --- */

@media (max-width: 767px) {
    .table-mobile-cards {
        display: none; /* Hidden by default, shown when .mobile-view active */
    }

    .table-mobile-cards.active {
        display: block;
    }

    .mobile-card {
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 1rem;
        margin-bottom: 1rem;
        background: white;
    }

    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .mobile-card-row:last-child {
        border-bottom: none;
    }

    .mobile-card-label {
        font-weight: 600;
        color: #64748b;
        font-size: 0.875rem;
    }

    .mobile-card-value {
        color: #1e293b;
        text-align: right;
    }
}

/* --- Responsive Table Styling --- */

@media (max-width: 1023px) {
    table {
        font-size: 0.875rem; /* Smaller text on tablets */
    }

    th, td {
        padding: 0.5rem !important; /* Tighter spacing */
    }
}

@media (max-width: 767px) {
    table {
        font-size: 0.8125rem; /* Even smaller on mobile */
    }

    th, td {
        padding: 0.375rem !important;
        /* Allow text wrapping for better mobile readability */
    }
}

/* ============================================================================
   RESPONSIVE GRID UTILITIES
   ============================================================================ */

/* --- Responsive Grid Classes --- */

.grid-responsive-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid-responsive-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.grid-responsive-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1rem;
}

/* Stack on tablet */
@media (max-width: 1023px) {
    .grid-responsive-4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Stack on mobile */
@media (max-width: 767px) {
    .grid-responsive-2,
    .grid-responsive-3,
    .grid-responsive-4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* --- Form Grid Responsive --- */

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.form-grid.cols-3 {
    grid-template-columns: 2fr 1fr 1fr;
}

.form-grid.cols-4 {
    grid-template-columns: 2fr 1fr 1fr auto;
}

@media (max-width: 767px) {
    .form-grid.cols-2,
    .form-grid.cols-3,
    .form-grid.cols-4 {
        grid-template-columns: 1fr;
    }
}

/* --- Detail Grid (Label: Value) --- */

.detail-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0.75rem;
}

@media (max-width: 767px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .detail-grid strong {
        display: block;
        margin-bottom: 0.25rem;
        color: #64748b;
        font-size: 0.875rem;
    }
}

/* ============================================================================
   MOBILE-SPECIFIC IMPROVEMENTS
   ============================================================================ */

/* --- Reduce Stat Card Minimum --- */

@media (max-width: 767px) {
    /* Allow smaller stat cards on mobile */
    .container > div[style*="grid-template-columns: repeat(auto-fit, minmax(280px"] {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    }

    /* Reduce stat text sizes */
    .container sl-card div[style*="font-size: 2.5rem"] {
        font-size: 2rem !important;
    }
}

/* --- Improve Button Groups --- */

@media (max-width: 767px) {
    /* Stack button groups vertically */
    div[style*="display: flex"] > sl-button {
        width: 100%;
    }
}

/* --- Responsive Card Spacing --- */

@media (max-width: 767px) {
    sl-card {
        margin-bottom: 1rem !important;
    }

    sl-card[style*="margin-bottom: 2rem"] {
        margin-bottom: 1rem !important;
    }
}

/* --- Message Thread Mobile --- */

@media (max-width: 767px) {
    /* Stack message headers */
    div[style*="display: flex; justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
}

/* --- Badge Wrapping --- */

@media (max-width: 767px) {
    td sl-badge {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

