/* Statistics Page Specific Styles */

.chart-container {
    position: relative;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.heatmap-year {
    margin-bottom: 30px;
}

.heatmap-year h3 {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.heatmap-streaks {
    display: flex;
    justify-content: flex-start;
    gap: 40px;
    margin-bottom: 20px;
    font-size: 14px;
}

.heatmap-streak-item {
    text-align: center;
}

.heatmap-streak-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: 5px;
}

.heatmap-streak-label {
    color: var(--text-tertiary);
}

.heatmap-container-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.heatmap-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.heatmap-day-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 20px;
}

.heatmap-day-label {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: normal;
}

.heatmap-month-labels {
    display: grid;
    grid-template-columns: repeat(53, minmax(10px, 1fr));
    gap: 2px;
    margin-bottom: 5px;
    height: 15px;
}

.heatmap-month-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-align: left;
    align-self: end;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(53, minmax(10px, 1fr));
    grid-template-rows: repeat(7, minmax(10px, 1fr));
    gap: 2px;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 53/7;
}

.heatmap-cell {
    width: 100%;
    height: 100%;
    background-color: var(--bg-tertiary);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    min-width: 10px;
    min-height: 10px;
}

.heatmap-cell.level-1 { background-color: #c6e48b; }
.heatmap-cell.level-2 { background-color: #7bc96f; }
.heatmap-cell.level-3 { background-color: #239a3b; }
.heatmap-cell.level-4 { background-color: #196127; }

.heatmap-cell:hover {
    stroke: #1f2328;
    stroke-width: 1px;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    color: #586069;
}

.heatmap-legend-item {
    width: 12px;
    height: 12px;
    margin: 0 2px;
    border-radius: 2px;
}

/* Kanji Grid Styles - Moved to shared kanji-grid.css */

/* Delete Game Entry Section Styles */
.delete-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
/* Dashboard card styles moved to dashboard-shared.css */
/* Tooltip styles are now only in shared.css */

/* Loading State */
.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-tertiary);
}

.dashboard-loading .spinner {
    margin-right: 10px;
}

/* Error State */
.dashboard-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--danger-color);
}

.dashboard-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.dashboard-error-message {
    font-size: 16px;
    margin-bottom: 16px;
}

.dashboard-retry-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.dashboard-retry-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* Responsive Design for Dashboard */
@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .dashboard-card {
        padding: 20px;
    }
    
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .dashboard-stat-value {
        font-size: 20px;
    }
    
    .dashboard-progress-items {
        flex-direction: column;
        gap: 12px;
    }
    
    .dashboard-card-title {
        font-size: 18px;
    }
    
    .delete-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-btn, .delete-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-card {
        padding: 16px;
    }
    
    .dashboard-stat-item {
        padding: 16px;
    }
    
    .dashboard-stat-value {
        font-size: 22px;
    }
}

/* Goal Progress Chart Styles */
.goal-progress-chart {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-color);
    border: 1px solid var(--border-color);
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.goal-progress-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2ee6e0, #3be62f, #e6dc2e);
    border-radius: 12px 12px 0 0;
}

.goal-progress-chart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.goal-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.goal-progress-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.goal-progress-item:hover {
    background: var(--border-color);
    transform: scale(1.02);
}

.goal-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.goal-progress-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.goal-icon {
    font-size: 20px;
    opacity: 0.8;
}

.goal-progress-values {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

.goal-current {
    color: var(--text-primary);
}

.goal-separator {
    color: var(--text-tertiary);
    margin: 0 4px;
}

.goal-target {
    color: var(--text-secondary);
}

.goal-progress-bar {
    height: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.goal-progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--text-tertiary); /* Default color for 0% */
    position: relative;
    overflow: hidden;
}

.goal-progress-fill[data-percentage="100"] {
    background: #2ee6e0; /* 100% completion - cyan */
}

.goal-progress-fill[data-percentage="75"] {
    background: #3be62f; /* 75% completion - green */
}

.goal-progress-fill[data-percentage="50"] {
    background: #3be62f; /* 50% completion - green */
}

.goal-progress-fill[data-percentage="25"] {
    background: #e6dc2e; /* 25% completion - yellow */
}

/* Dynamic progress fill colors based on completion percentage */
.goal-progress-fill.completion-100 { background: #2ee6e0; }
.goal-progress-fill.completion-75 { background: #3be62f; }
.goal-progress-fill.completion-50 { background: #3be62f; }
.goal-progress-fill.completion-25 { background: #e6dc2e; }
.goal-progress-fill.completion-0 {
    background: var(--text-tertiary);
}

[data-theme="dark"] .goal-progress-fill.completion-0 {
    background: #333;
}

[data-theme="light"] .goal-progress-fill.completion-0 {
    background: #fff;
    border: 1px solid var(--border-color);
}

.goal-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.goal-percentage {
    font-weight: 600;
    color: var(--text-primary);
}

.goal-projection {
    color: var(--text-secondary);
    font-style: italic;
}

/* Loading and Error States */
.goal-progress-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-tertiary);
}

.goal-progress-loading .spinner {
    margin-right: 10px;
}

.goal-progress-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--danger-color);
}

.goal-progress-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.goal-progress-error-message {
    font-size: 16px;
    margin-bottom: 16px;
}

/* Dashboard card, stats grid, progress section, streak indicator, and date range styles are now in dashboard-shared.css */

/* ================================
   Loading State
================================ */
.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-tertiary);
}

.dashboard-loading .spinner {
    margin-right: 10px;
}

/* ================================
   Error State
================================ */
.dashboard-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--danger-color);
}

.dashboard-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.dashboard-error-message {
    font-size: 16px;
    margin-bottom: 16px;
}

.dashboard-retry-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.dashboard-retry-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* Popup styles are now in popups-shared.css */

/* Responsive Design for Goal Progress Chart */
@media (max-width: 768px) {
    .goal-progress-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .goal-progress-item {
        padding: 16px;
    }
    
    .goal-progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .goal-progress-values {
        font-size: 12px;
    }
    
    .goal-progress-label {
        font-size: 14px;
    }
    
    .goal-progress-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .goal-progress-chart {
        padding: 16px;
    }
    
    .goal-progress-item {
        padding: 12px;
    }
    
    .goal-icon {
        font-size: 16px;
    }
    
    .goal-progress-label {
        font-size: 13px;
    }
    
    .goal-progress-bar {
        height: 10px;
    }
}

/* Navigation styles */
.navigation .nav-link:hover {
    background-color: var(--accent-color) !important;
    color: var(--bg-secondary) !important;
}

@media (max-width: 768px) {
    .navigation {
        padding: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .navigation > div {
        flex-direction: column;
        gap: 10px;
    }
    
    .navigation .nav-link {
        display: block !important;
        text-align: center;
        width: 100%;
    }
    
    .theme-toggle {
        margin-left: 0;
        align-self: center;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-date-range {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .dashboard-date-item {
        width: 100%;
    }

    .dashboard-fetch-btn {
        width: 100%;
    }
}


.no-data-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.no-data-popup.hidden {
    display: none;
}

.no-data-content {
    background: var(--bg-secondary);
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.no-data-content p {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 15px;
}

.no-data-content button {
    padding: 8px 16px;
    background: var(--accent-color);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.no-data-content button:hover {
    background: #0056b3;
}

/* ================================
   Goals Page Specific Styles
================================ */
.dashboard-card.today-goals::before {
    background: linear-gradient(90deg, #e6dc2e, #3be62f);
}

.dashboard-card.projection-card::before {
    background: linear-gradient(90deg, #3be62f, #2ee6e0);
}

.no-targets-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 14px;
}

.no-targets-message::before {
    content: '⚙️';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}


/* Goal stat item with vertical progress/required layout */
.goal-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    transition: all 0.3s ease;
    padding: 20px 12px;
}

.goal-stat-item .goal-progress-value {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
    margin-bottom: 12px;
}

.goal-stat-item .goal-divider {
    width: 90%;
    height: 2px;
    background: var(--border-color);
    margin: 10px 0;
}

.goal-stat-item .goal-required-value {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-top: 12px;
    margin-bottom: 12px;
}

.goal-stat-item .dashboard-stat-label {
    margin-top: 12px;
    font-size: 13px;
}

/* Green highlight when goal is met */
.goal-stat-item.goal-met {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.1) 100%);
    border: 2px solid rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.goal-stat-item.goal-met .goal-progress-value,
.goal-stat-item.goal-met .goal-required-value {
    color: #22c55e;
}

.goal-stat-item.goal-met .goal-divider {
    background: rgba(34, 197, 94, 0.6);
    height: 3px;
}

.goal-stat-item.goal-met .dashboard-stat-label {
    color: #22c55e;
    font-weight: 600;
}

/* Goal stat item - simple inline format showing TODAY / GOAL */
.goal-stat-item .dashboard-stat-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.goal-stat-item .goal-separator {
    font-size: 0.8em;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* ================================
   Pace Indicator Badges
================================ */
.pace-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-left: 6px;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    vertical-align: middle;
}

.pace-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Over-achieving - Green gradient */
.pace-badge.pace-ahead {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pace-badge.pace-ahead:hover {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Perfect pace - Cyan */
.pace-badge.pace-perfect {
    background: #2ee6e0;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pace-badge.pace-perfect:hover {
    box-shadow: 0 4px 12px rgba(46, 230, 224, 0.4);
}

/* Slightly behind - Orange gradient */
.pace-badge.pace-behind-mild {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pace-badge.pace-behind-mild:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Significantly behind - Red gradient */
.pace-badge.pace-behind {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pace-badge.pace-behind:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Responsive design for pace badges */
@media (max-width: 768px) {
    .pace-badge {
        font-size: 10px;
        padding: 2px 8px;
        margin-left: 4px;
    }
}

@media (max-width: 480px) {
    .pace-badge {
        font-size: 9px;
        padding: 2px 6px;
        margin-left: 3px;
    }
}