/* Weather Activity Map Styles */

.activity-map {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    flex-direction: row;
    gap: 1px;
    font-family: monospace;
    overflow: visible;
    padding: 20px 0 10px 0;
    width: 100%;
    max-width: 100%;
}

/* Remove scrollbar styling since we're eliminating horizontal scroll */

.activity-week {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.activity-day {
    width: 100%;
    aspect-ratio: 1;
    min-width: 6px;
    max-width: 12px;
    border-radius: 1px;
    border: 1px solid #e1e4e8;
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
}

/* Responsive sizing for different screen sizes */
@media (min-width: 480px) {
    .activity-map {
        gap: 2px;
    }

    .activity-week {
        gap: 2px;
    }

    .activity-day {
        border-radius: 2px;
        max-width: 14px;
    }
}

@media (min-width: 768px) {
    .activity-map {
        gap: 3px;
        padding: 30px 0 10px 0;
    }

    .activity-week {
        gap: 3px;
    }

    .activity-day {
        max-width: 16px;
    }
}

@media (min-width: 1024px) {
    .activity-day {
        max-width: 18px;
    }
}

/* Custom tooltip styling for faster display */
.activity-day:hover {
    border-color: #586069;
    transform: scale(1.1);
    z-index: 999;
    position: relative;
}

/* Default tooltip positioning (center above) */
.activity-day[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 5px;
    opacity: 0;
    animation: tooltipFadeIn 0.1s ease forwards;
    min-width: max-content;
    max-width: 300px;
    text-align: center;
    word-wrap: break-word;
}

/* Tooltip positioning for left side of screen */
.activity-week:nth-child(-n+10) .activity-day[title]:hover::after {
    left: 0;
    transform: translateX(0);
    transform-origin: left;
}

/* Tooltip positioning for right side of screen */
.activity-week:nth-last-child(-n+10) .activity-day[title]:hover::after {
    left: auto;
    right: 0;
    transform: translateX(0);
    transform-origin: right;
}

/* Mobile tooltip improvements */
@media (max-width: 767px) {
    .activity-day[title]:hover::after {
        position: fixed;
        bottom: 20px;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        max-width: 90vw;
        text-align: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 1001;
        padding: 10px 15px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* Disable hover effects on touch devices */
    .activity-day:hover {
        transform: none;
        border-color: #e1e4e8;
    }

    /* Add tap highlight for mobile */
    .activity-day {
        -webkit-tap-highlight-color: rgba(88, 96, 105, 0.2);
    }

    /* Touch-friendly interactions */
    .activity-day {
        min-height: 10px;
        min-width: 10px;
        touch-action: manipulation;
    }

    /* Ensure no overflow on mobile */
    .activity-map {
        overflow: visible;
    }
}

/* Enhanced mobile styles for very small screens */
@media (max-width: 360px) {
    .activity-container {
        padding: 10px;
        margin: 5px;
    }

    .city-header h2 {
        font-size: 1.5rem;
    }

    h1 {
        font-size: 1.25rem !important;
    }

    .activity-legend {
        font-size: 10px;
        gap: 4px;
    }

    .legend-square {
        width: 7px;
        height: 7px;
    }

    .day-labels {
        width: 15px;
        margin-right: 3px;
        font-size: 7px;
    }

    .activity-day {
        min-width: 4px;
        max-width: 8px;
    }
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Hide default browser tooltip */
.activity-day[title] {
    position: relative;
}

.activity-day.empty {
    background-color: transparent;
    border: none;
}

/* Precipitation levels - Blue gradient */
.activity-day.level-0 {
    background-color: #ebedf0;
}

.activity-day.level-1 {
    background-color: #bfdbfe;
}

.activity-day.level-2 {
    background-color: #93c5fd;
}

.activity-day.level-3 {
    background-color: #60a5fa;
}

.activity-day.level-4 {
    background-color: #3b82f6;
}

.activity-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: #586069;
    margin-top: 15px;
    padding: 0 10px;
}

@media (min-width: 480px) {
    .activity-legend {
        gap: 8px;
        font-size: 12px;
        flex-wrap: nowrap;
    }
}

@media (min-width: 768px) {
    .activity-legend {
        margin-top: 10px;
        padding: 0;
    }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .legend-item {
        gap: 4px;
    }
}

.legend-square {
    width: 8px;
    height: 8px;
    border-radius: 1px;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .legend-square {
        width: 10px;
        height: 10px;
        border-radius: 2px;
    }
}

.activity-container {
    background: white;
    padding: 15px;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    overflow: visible;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .activity-container {
        padding: 25px;
        border-radius: 12px;
    }
}

.city-header {
    margin: 5px 0 15px 0;
}

@media (min-width: 768px) {
    .city-header {
        margin: 10px 0 20px 0;
    }
}

.city-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    color: #1f2937;
}

@media (min-width: 768px) {
    .city-header h2 {
        font-size: 2rem;
    }
}

.demo-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px 0 20px 0;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

.demo-badge {
    display: inline-block;
    background: #f59e0b;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.demo-notice p {
    margin: 0;
    color: #92400e;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .demo-notice {
        padding: 16px 20px;
        margin: 20px 0 25px 0;
    }

    .demo-badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .demo-notice p {
        font-size: 0.9rem;
    }
}

.city-selector {
    margin: 15px 0;
    font-size: 14px;
}

@media (min-width: 768px) {
    .city-selector {
        margin: 20px 0;
    }
}

.city-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .city-badges {
        gap: 10px;
        margin-bottom: 20px;
    }
}

.city-selector label {
    display: block;
    margin-bottom: 8px;
    color: #586069;
    font-weight: 500;
}

@media (min-width: 480px) {
    .city-selector label {
        display: inline;
        margin-right: 10px;
        margin-bottom: 0;
    }
}

.city-search-container {
    position: relative;
    display: inline-block;
    min-width: 200px;
    max-width: 100%;
}

.city-search-container input {
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.city-search-container input:focus {
    outline: none;
    border-color: #586069;
    box-shadow: 0 0 5px rgba(88, 96, 105, 0.3);
}

.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5da;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f6f8fa;
    font-size: 14px;
    transition: background-color 0.1s ease;
}

.suggestion-item:hover {
    background-color: #f6f8fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.day-labels {
    margin-right: 4px;
    font-size: 8px;
    color: #586069;
    flex-shrink: 0;
    width: 18px;
}

@media (min-width: 480px) {
    .day-labels {
        margin-right: 6px;
        font-size: 9px;
        width: 20px;
    }
}

@media (min-width: 768px) {
    .day-labels {
        margin-right: 8px;
        font-size: 10px;
        width: 25px;
    }
}

.day-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 1px;
    flex: 1;
}

@media (min-width: 480px) {
    .day-label {
        margin-bottom: 2px;
    }
}

@media (min-width: 768px) {
    .day-label {
        margin-bottom: 3px;
    }
}

.day-label:last-child {
    margin-bottom: 0;
}

.map-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 25px;
}

@media (min-width: 768px) {
    .map-card {
        padding: 30px;
        margin-top: 30px;
    }
}

.map-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 5px 0;
    text-align: center;
}

@media (min-width: 768px) {
    .map-title {
        font-size: 1.5rem;
        margin: 10px 0;
    }
}

.map-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: visible;
    width: 100%;
}

.month-labels {
    display: none;
}

@media (min-width: 768px) {
    .month-labels {
        display: flex;
        gap: 3px;
        margin-bottom: 5px;
        margin-left: 35px;
        font-size: 10px;
        color: #586069;
    }
}

.month-label {
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}