/**
 * NCAAM Pattern Dashboard Styles
 * Dedicated styling for Alert/Watch pattern dashboard
 *
 * Theme: Dark Slate/Charcoal with white text and gold accents
 * Updated: January 13, 2026
 */

/* ============================================
   Color Variables
   ============================================ */
:root {
    --dash-bg-dark: #000000;
    --dash-bg-mid: #0a0a0a;
    --dash-bg-light: #1a1a1a;
    --dash-card-bg: rgba(255, 255, 255, 0.04);
    --dash-card-border: rgba(255, 255, 255, 0.12);
    --dash-text-primary: #ffffff;
    --dash-text-secondary: #b0b8c4;
    --dash-text-muted: #7a8594;
    --dash-accent-green: #3CB371;
    --dash-accent-gold: #FFD700;
    --dash-accent-gold-hover: #e6c200;
    --dash-accent-amber: #F7931E;
    --dash-hot-orange: #FF6B35;
    --dash-cold-red: #FF6B6B;
}

/* ============================================
   Dashboard Wrapper
   ============================================ */
.shamlock-dashboard-wrapper {
    background: var(--dash-bg-dark);
    min-height: 100vh;
    padding-bottom: 60px;
    color: var(--dash-text-primary);
}

/* ============================================
   Section Headers
   ============================================ */
.shamlock-header {
    padding: 40px 0 30px;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.page-title .accent {
    color: #3CB371;
}

.shamlock-subtitle {
    font-size: 1.1rem;
    color: var(--dash-text-secondary);
    margin: 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: #ffffff;
}

.section-title .accent {
    color: #3CB371;
}

/* Section badge within titles - ensure white text */
.section-title .section-badge {
    color: inherit;
}

.section-title .fire-emoji {
    animation: pulse-fire 1.5s ease-in-out infinite;
}

@keyframes pulse-fire {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.section-description {
    color: var(--dash-text-secondary);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* ============================================
   Container
   ============================================ */
.shamlock-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Filters
   ============================================ */
.shamlock-dashboard-filters {
    padding: 20px 0;
}

.filters-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shamlock-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 35px 10px 15px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
}

.shamlock-select:focus {
    outline: none;
    border-color: #3CB371;
    box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.2);
}

/* Style dropdown options for dark theme */
.shamlock-select option {
    background: #1a1a1a;
    color: #fff;
    padding: 10px;
}

/* Compact select for comparison dropdown */
.shamlock-select-compact {
    min-width: auto;
    padding: 10px 30px 10px 12px;
    font-size: 0.85rem;
    background-position: right 6px center;
    background-size: 16px;
}

/* ============================================
   Pattern Legend
   ============================================ */
.shamlock-pattern-legend {
    padding: 15px 0 25px;
}

.legend-items {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-badge {
    background: rgba(60, 179, 113, 0.2);
    color: #3CB371;
    border: 1px solid rgba(60, 179, 113, 0.4);
}

.watch-badge {
    background: rgba(255, 215, 0, 0.15);
    color: var(--dash-accent-gold);
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.legend-desc {
    color: var(--dash-text-secondary);
    font-size: 0.85rem;
}

/* ============================================
   Alert, Watch & Badge Sections
   ============================================ */
.shamlock-alert-section,
.shamlock-watch-section,
.shamlock-badge-section {
    padding: 30px 0;
}

.shamlock-alert-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shamlock-watch-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-badge {
    font-size: 0.65em;
    padding: 4px 10px;
    border-radius: 4px;
    vertical-align: middle;
}

/* Badge section styling */
.badge-badge {
    background: rgba(60, 179, 113, 0.2);
    color: #3CB371;
    border: 1px solid rgba(60, 179, 113, 0.4);
}

.pattern-card.badge-card {
    border-color: rgba(60, 179, 113, 0.4);
    background: linear-gradient(135deg, rgba(60, 179, 113, 0.08) 0%, rgba(34, 139, 34, 0.04) 100%);
}

/* Loading placeholder styling */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--dash-text-muted);
    width: 100%;
}

.loading-placeholder .loading-spinner {
    margin-bottom: 15px;
}

/* Empty section state */
.shamlock-alert-section:has(.pattern-cards-grid:empty),
.shamlock-watch-section:has(.pattern-cards-grid:empty),
.shamlock-badge-section:has(.pattern-cards-grid:empty) {
    display: none;
}

/* No patterns message */
.no-patterns-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--dash-text-muted);
    font-style: italic;
}

/* ============================================
   Pattern Cards Grid - Fixed Width Centered Layout
   ============================================ */
.pattern-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

/* Empty state for sections with no patterns */
.pattern-cards-grid:empty::after {
    content: 'No active patterns';
    color: var(--dash-text-muted);
    text-align: center;
    padding: 40px;
    width: 100%;
}

/* ============================================
   Pattern Card - Fixed Width
   ============================================ */
.pattern-card {
    width: 320px;
    max-width: 100%;
    flex-shrink: 0;
    background: var(--dash-card-bg);
    border: 1px solid var(--dash-card-border);
    border-radius: 16px;
    padding: 25px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pattern-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.pattern-card.alert-card {
    border-color: rgba(60, 179, 113, 0.3);
    background: linear-gradient(135deg, rgba(60, 179, 113, 0.05) 0%, var(--dash-card-bg) 100%);
}

/* Leprechaun's Gold - Special gold styling */
.pattern-card.gold-card {
    border-color: rgba(212, 175, 55, 0.5);
    border-width: 2px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(255, 215, 0, 0.05) 100%);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.pattern-card.gold-card:hover {
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.3);
}

.pattern-card.gold-card .pattern-icon {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.pattern-card.watch-card {
    border-color: rgba(255, 215, 0, 0.3);
}

.pattern-card.hot-streak {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(247, 147, 30, 0.04) 100%);
}

/* Hot Badge */
.hot-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, var(--dash-accent-gold), var(--dash-accent-amber));
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(255, 215, 0, 0.6); }
}

/* Pattern Header */
.pattern-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.pattern-icon {
    font-size: 2.5rem;
}

.pattern-title-block {
    flex: 0 1 auto;
}

.pattern-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #fff;
}

.pattern-criteria {
    font-size: 0.85rem;
    color: var(--dash-text-secondary);
}

/* Pattern Stats */
.pattern-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
    align-items: flex-end;
    justify-content: center;
}

.pattern-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pattern-stat.main-stat .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

/* Secondary stat aligns baseline with main stat */
.pattern-stat:not(.main-stat) {
    justify-content: flex-end;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.stat-value.hot-pct {
    color: #3CB371;
}

.stat-value.cold-pct {
    color: #FF6B6B;
}

.stat-value.neutral-pct {
    color: #FFA500;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Pattern Comparison */
.pattern-comparison {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comparison-label {
    font-size: 0.85rem;
    color: var(--dash-text-muted);
}

.comparison-value {
    font-size: 0.95rem;
    color: var(--dash-text-secondary);
}

.comparison-delta {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 0;
}

.delta-positive {
    color: #3CB371;
}

.delta-negative {
    color: #FF6B6B;
}

.delta-neutral {
    color: var(--dash-text-muted);
}

/* Pattern Notes */
.pattern-notes {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--dash-text-muted);
    font-style: italic;
}

/* ============================================
   Comparison Section
   ============================================ */
.shamlock-comparison-section {
    padding: 40px 0;
}

.comparison-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--dash-card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--dash-card-border);
}

.comparison-table th {
    background: var(--dash-bg-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dash-text-secondary);
    font-weight: 600;
}

/* Table header with inline select dropdown */
.th-with-select {
    padding: 8px 12px;
}

.table-header-select {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 24px 6px 8px;
    color: var(--dash-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23b0b8c4' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 14px;
}

.table-header-select:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.table-header-select:focus {
    outline: none;
    border-color: #3CB371;
}

/* Style table header dropdown options for dark theme */
.table-header-select option {
    background: #1a1a1a;
    color: #fff;
    padding: 8px;
}

.comparison-table td {
    font-size: 0.95rem;
}

.comparison-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.pattern-name-cell {
    font-weight: 600;
    color: #fff;
}

.type-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}

.status-hot {
    color: var(--dash-accent-gold);
}

.status-warm {
    color: var(--dash-accent-amber);
}

.status-consistent {
    color: #3CB371;
}

.status-neutral {
    color: var(--dash-text-muted);
}

.status-cold {
    color: #FF6B6B;
}

.loading-cell,
.error-cell,
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--dash-text-muted);
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(60, 179, 113, 0.2);
    border-top-color: #3CB371;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Insights Section
   ============================================ */
.shamlock-insights-section {
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.insight-card {
    background: var(--dash-card-bg);
    border: 1px solid var(--dash-card-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
}

.insight-card.hot-insight {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(247, 147, 30, 0.05) 100%);
    border-color: rgba(255, 215, 0, 0.3);
}

.insight-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.insight-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #fff;
}

.insight-content p {
    font-size: 0.9rem;
    color: var(--dash-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.insight-content strong {
    color: #3CB371;
}

/* ============================================
   Navigation Links
   ============================================ */
.shamlock-nav-links {
    padding: 30px 0;
}

.nav-links-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3CB371;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 20px;
    background: rgba(60, 179, 113, 0.1);
    border: 1px solid rgba(60, 179, 113, 0.3);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(60, 179, 113, 0.2);
    color: #fff;
}

.nav-arrow {
    font-size: 1.1rem;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.35rem;
    }

    /* Cards stack vertically and fill width on tablet/mobile */
    .pattern-cards-grid {
        flex-direction: column;
        align-items: center;
    }

    .pattern-card {
        width: 100%;
        max-width: 400px;
        padding: 20px;
    }

    .pattern-stat.main-stat .stat-value {
        font-size: 2rem;
    }

    .legend-items {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }

    .nav-links-row {
        flex-direction: column;
    }

    .nav-link {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .shamlock-container {
        padding: 0 15px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    /* Keep stats inline on mobile, just reduce gap */
    .pattern-stats {
        flex-direction: row;
        gap: 25px;
        justify-content: center;
    }

    .pattern-stat.main-stat .stat-value {
        font-size: 1.75rem;
    }

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

    /* Horizontal scroll for comparison table on mobile */
    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }

    .comparison-table {
        font-size: 0.8rem;
        min-width: 600px; /* Force horizontal scroll */
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Show scroll hint on mobile */
    .comparison-table-wrapper::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.3));
        pointer-events: none;
    }

    .comparison-table-wrapper {
        position: relative;
    }
}

/* ============================================
   GATING: Premium-Only Dashboard CTA
   Per gating spec v2 Part 4: "Free users: GATE — no access to interactive dashboard"
   ============================================ */

.shamlock-dashboard-gated {
    padding: 80px 0;
    text-align: center;
}

.gated-content-card {
    background: var(--dash-card-bg);
    border: 1px solid var(--dash-card-border);
    border-radius: 16px;
    padding: 60px 40px;
    max-width: 600px;
    margin: 0 auto;
}

.gated-content-card .gated-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.gated-content-card h2 {
    color: var(--dash-accent-gold);
    font-size: 1.75rem;
    margin: 0 0 15px 0;
}

.gated-content-card .gated-headline {
    color: var(--dash-text-primary);
    font-size: 1.2rem;
    margin: 0 0 15px 0;
}

.gated-content-card .gated-description {
    color: var(--dash-text-secondary);
    margin: 0 0 25px 0;
    font-size: 1rem;
    line-height: 1.6;
}

.gated-content-card .gated-features {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    display: inline-block;
}

.gated-content-card .gated-features li {
    color: var(--dash-text-secondary);
    padding: 8px 0;
    padding-left: 28px;
    position: relative;
}

.gated-content-card .gated-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--dash-accent-green);
    font-weight: bold;
}

.gated-content-card .shamlock-upgrade-btn {
    display: inline-block;
    background: var(--dash-accent-gold);
    color: #000;
    font-weight: 600;
    padding: 14px 40px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.gated-content-card .shamlock-upgrade-btn:hover {
    background: var(--dash-accent-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

@media (max-width: 640px) {
    .gated-content-card {
        padding: 40px 24px;
        margin: 0 16px;
    }

    .gated-content-card h2 {
        font-size: 1.5rem;
    }

    .gated-content-card .gated-headline {
        font-size: 1.1rem;
    }
}
