/* ===========================================
   Pozo Perdigueras - Frontend Chart Styles
   Estética limpia y moderna, compatible con Flatsome
   =========================================== */

.pozo-chart-container {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Header & Year Selector ---- */
.pozo-chart-header {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.pozo-year-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 12px;
    padding: 6px 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pozo-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #2e578b;
    transition: background 0.2s, color 0.2s;
}

.pozo-nav-btn:hover {
    background: #f0f3f7;
}

.pozo-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.pozo-nav-btn:disabled:hover {
    background: transparent;
}

.pozo-year-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    font-size: 1.3rem;
    font-weight: 700;
    color: #2e578b;
    text-align: center;
    cursor: pointer;
    padding: 4px 24px 4px 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%232e578b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    outline: none;
}

.pozo-year-select:focus {
    outline: none;
}

/* ---- Bar Chart ---- */
.pozo-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 320px;
    padding: 0 4px;
    gap: 6px;
    margin-bottom: 30px;
    position: relative;
}

@media (min-width: 768px) {
    .pozo-bar-chart {
        height: 350px;
        gap: 10px;
    }
}

.pozo-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.pozo-bar-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

.pozo-bar {
    width: 70%;
    max-width: 56px;
    min-height: 4px;
    background: linear-gradient(180deg, #3a6a9e 0%, #2e578b 100%);
    border-radius: 8px 8px 4px 4px;
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
    position: relative;
}

.pozo-bar-col:hover .pozo-bar {
    background: linear-gradient(180deg, #4a80b5 0%, #2e578b 100%);
    filter: brightness(1.1);
}

.pozo-bar[data-value=""] {
    background: #e2e5e9;
    min-height: 4px;
}

/* Tooltip */
.pozo-tooltip {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: #1a2a3a;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pozo-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1a2a3a;
}

.pozo-bar-col:hover .pozo-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-100%) translateY(-4px);
}

/* Month labels */
.pozo-bar-label {
    font-size: 0.82rem;
    color: #8b95a3;
    font-weight: 500;
    margin-top: 12px;
    letter-spacing: 0.02em;
}

/* ---- Stats Row ---- */
.pozo-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    padding: 24px 0;
    border-top: 1px solid #eef0f3;
    border-bottom: 1px solid #eef0f3;
}

@media (max-width: 600px) {
    .pozo-stats {
        gap: 20px;
    }
}

.pozo-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pozo-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2e578b;
    line-height: 1.2;
}

@media (max-width: 600px) {
    .pozo-stat-value {
        font-size: 1.3rem;
    }
}

.pozo-stat-label {
    font-size: 0.82rem;
    color: #8b95a3;
    font-weight: 500;
}

/* ---- Evolution Line Chart ---- */
.pozo-evolution {
    margin-top: 10px;
}

.pozo-evolution-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px 0;
    text-align: center;
}

.pozo-evolution-subtitle {
    font-size: 0.9rem;
    color: #8b95a3;
    text-align: center;
    margin: 0 0 24px 0;
}

.pozo-line-chart {
    position: relative;
    height: 200px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .pozo-line-chart {
        height: 240px;
    }
}

.pozo-line-chart svg {
    width: 100%;
    height: 100%;
}

.pozo-line-path {
    fill: none;
    stroke: #2e578b;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pozo-line-area {
    fill: url(#pozo-gradient);
    opacity: 0.15;
}

.pozo-line-dot {
    fill: #2e578b;
    transition: r 0.2s;
    cursor: pointer;
}

.pozo-line-dot:hover {
    r: 5;
}

.pozo-line-dot.active {
    fill: #CECF10;
    stroke: #2e578b;
    stroke-width: 2;
    r: 6;
}

.pozo-line-label {
    fill: #8b95a3;
    font-size: 11px;
    text-anchor: middle;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pozo-line-grid {
    stroke: #eef0f3;
    stroke-width: 1;
}

.pozo-line-grid-label {
    fill: #aab2bd;
    font-size: 10px;
    text-anchor: end;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Line chart tooltip */
.pozo-line-tooltip {
    position: absolute;
    background: #1a2a3a;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translate(-50%, -120%);
}

.pozo-line-tooltip.visible {
    opacity: 1;
}

/* ---- Loading state ---- */
.pozo-loading .pozo-bar {
    animation: pozo-pulse 1s ease-in-out infinite;
}

@keyframes pozo-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* ---- Responsive adjustments for Flatsome ---- */
.row .pozo-chart-container {
    width: 100%;
}

@media (max-width: 549px) {
    .pozo-bar-chart {
        height: 240px;
        gap: 3px;
    }

    .pozo-bar-label {
        font-size: 0.72rem;
    }

    .pozo-bar {
        width: 80%;
        border-radius: 5px 5px 3px 3px;
    }

    .pozo-tooltip {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}
