/**
 * Monthly Target Tracker — Stylesheet
 * Version: 2.3 (cleaned)
 */

/* ── Widget container ─────────────────────────────────────────────────────── */
.mtt-widget {
    max-width: 100%;
    margin: 10px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

/* ── Form inputs ──────────────────────────────────────────────────────────── */

.mtt-input {

    width: 100%;

    padding: 10px 18px;

    margin-top: 5px;

    border: 2px solid #666666;

    border-radius: 30px;

    box-sizing: border-box;

}



.mtt-submit-btn {

    background: #2271b1;

    color: #fff;

    padding: 10px 20px;

    border: none;

    border-radius: 5px;

    cursor: pointer;

    font-size: 14px;

}

.mtt-submit-btn:hover {

    background: #1a5a8f;

}



/* ── Result box ───────────────────────────────────────────────────────────── */

.mtt-result-box {

    margin-top: 20px;

    padding: 15px;

    background: #fff;

    border-radius: 8px;

    border: 2px solid currentColor;

}



/* ── Hints ────────────────────────────────────────────────────────────────── */

.mtt-hint {

    font-size: 14px;

}

.mtt-hint--red   { color: red; }

.mtt-hint--green { color: green; }

.mtt-hint-small {

    font-size: 12px;

}



/* ── External box ─────────────────────────────────────────────────────────── */

.mtt-external-box {

    margin: 15px 0;

    padding: 12px;

    background: #55BDC330;

    border-radius: 8px;

}

.mtt-source {

    font-size: 12px;

    margin-top: 8px;

    margin-bottom: 0;

}



/* ── Divider ──────────────────────────────────────────────────────────────── */

.mtt-divider {

    margin: 20px 0;

}



/* ── Reference table ─────────────────────────────────────────────────────── */

.mtt-details {

    font-size: 14px;

    margin-top: 10px;

}

.mtt-details summary {

    cursor: pointer;

    font-weight: bold;

}

.mtt-ref-table {

    width: 300px;

    margin-top: 10px;

    margin-left: 12px;

    border-collapse: collapse;

}

.mtt-ref-table tr:first-child {

    background: #55BDC330;

}

.mtt-ref-table th,

.mtt-ref-table td {

    padding: 5px;

    text-align: left;

}



/* ── Canvas ───────────────────────────────────────────────────────────────── */

.mtt-canvas {

    width: 100%;

    height: 400px;

    background: #fff;

    border-radius: 8px;

    padding: 10px;

    box-sizing: border-box;

}



/* ── Legend ───────────────────────────────────────────────────────────────── */

.mtt-legend {

    margin-top: 15px;

    display: flex;

    gap: 20px;

    flex-wrap: wrap;

    font-size: 12px;

}

.mtt-legend-dot {

    display: inline-block;

    width: 12px;

    height: 12px;

    border-radius: 2px;

    margin-right: 4px;

    vertical-align: middle;

}



/* ── Variance header ──────────────────────────────────────────────────────── */

.mtt-variance-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    flex-wrap: wrap;

    margin-bottom: 15px;

}

.mtt-variance-controls {

    display: flex;

    gap: 10px;

    align-items: center;

}

.mtt-variance-title {

    font-size: 14px;

}

.mtt-last-update-wrap {

    font-size: 12px;

    color: #666;

}



/* ── Mode buttons ─────────────────────────────────────────────────────────── */

.mtt-mode-btn {

    background: #f0f0f0 !important;

    color: #158383 !important;

    border: 2px solid #158383 !important;

    padding: 6px 16px !important;

    border-radius: 5px;

    cursor: pointer;

    font-size: 12px;

}

.mtt-mode-btn--active {

    background: #158383 !important;

    color: #fff !important;

    font-weight: bold;

}



/* ── Variance badge ───────────────────────────────────────────────────────── */

.mtt-variance-badge {

    margin-bottom: 15px;

    padding: 10px;

    border-radius: 8px;

}

.mtt-variance-badge--ahead  { background: #e8f5e9; }

.mtt-variance-badge--behind { background: #ffebee; }



/* ── Chart wrap / loading / no-data ──────────────────────────────────────── */

.mtt-chart-wrap {

    min-height: 400px;

    position: relative;

}

.mtt-loading {

    text-align: center;

    padding: 20px;

}

.mtt-no-data {

    text-align: center;

    padding: 40px;

    color: #666;

}



/* ── Variance footer ──────────────────────────────────────────────────────── */

.mtt-variance-footer {

    margin-top: 15px;

    display: flex;

    gap: 20px;

    flex-wrap: wrap;

    justify-content: space-between;

    align-items: center;

}

.mtt-mode-indicator {

    font-size: 11px;

    color: #888;

}

.mtt-refresh-btn {

    background: #2271b1;

    color: #fff;

    border: none;

    padding: 5px 12px;

    border-radius: 5px;

    cursor: pointer;

    font-size: 12px;

}

.mtt-refresh-btn:hover {

    background: #1a5a8f;

}



/* ── Total Users Counter Widget ─────────────────────────────────────────────── */

.mtt-counter-widget {

    max-width: 400px;

    margin: 10px 0;

}

.mtt-counter-card {

    background: #ffffff;

    border-radius: 12px;

    padding: 1.5rem;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

    border: 1px solid #e2e8f0;

    transition: all 0.3s ease;

    cursor: pointer;

}

.mtt-counter-card:hover {

    transform: translateY(-2px);

}

.mtt-counter-value {

    font-family: 'Lato' !important;

    font-size: 2.5rem;

    font-weight: 700;

    color: #2c3e50;

    line-height: 1;

    margin-bottom: 5px;

    transition: transform 0.2s ease, opacity 0.2s ease;

    text-align: center;

}

.mtt-counter-label {

    font-size: 0.8rem;

    color: #718096;

    font-weight: 500;

    text-align: center;

    padding-bottom: 12px;

    border-bottom: 1px dashed #cbd5e0;

}

.mtt-counter-footer {

    display: flex;

    justify-content: center;

    align-items: center;

    border-top: 1px solid rgba(255, 255, 255, 0.2);

    padding-top: 14px;

}

.mtt-counter-status {

    font-family: 'Lato' !important;

    font-size: 10px !important;

    color: #718096 !important;

    display: flex;

    align-items: center;

    gap: 6px;

}

.mtt-status-dot {

    display: inline-block;

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background-color: #4ade80;

    animation: pulse 2s infinite;

}

.mtt-status-loading {

    background-color: #fbbf24;

    animation: none;

}

.mtt-status-success {

    background-color: #4ade80;

}

@keyframes pulse {

    0% {

        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);

    }

    70% {

        box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);

    }

    100% {

        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);

    }

}



/* ── Rotate-device overlay ────────────────────────────────────────────────── */

.mtt-chart-outer {

    position: relative;

}

.mtt-rotate-overlay {

    display: none;

    position: absolute;

    inset: 0;

    z-index: 10;

    background: rgba(249, 249, 249, 0.93);

    border-radius: 10px;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 12px;

    text-align: center;

    padding: 20px;

    box-sizing: border-box;

}

@media (max-width: 600px) {

    body.mtt-portrait .mtt-rotate-overlay {

        display: flex;

    }

}

.mtt-rotate-icon {

    font-size: 48px;

    animation: mtt-rock 1.4s ease-in-out infinite;

}

.mtt-rotate-text {

    font-size: 14px;

    font-weight: 600;

    color: #2c3e50;

    margin: 0;

}

.mtt-rotate-sub {

    font-size: 12px;

    color: #718096;

    margin: 0;

}

@keyframes mtt-rock {

    0%   { transform: rotate(0deg); }

    30%  { transform: rotate(-25deg); }

    60%  { transform: rotate(15deg); }

    80%  { transform: rotate(-8deg); }

    100% { transform: rotate(0deg); }

}



/* ── Real-data variance widget ────────────────────────────────────────────── */

.mtt-realdata-widget {

    border-color: #158383;  /* teal border distinguishes it from the synthetic chart */

}



.mtt-realdata-badge {

    display: inline-block;

    font-size: 10px;

    font-weight: 600;

    color: #158383;

    margin-left: 6px;

    vertical-align: middle;

    letter-spacing: 0.03em;

    text-transform: uppercase;

}