/* Enhanced Modern Right Panel - Login Page Theme for Government Use */

#right-panel {
    position: relative;
    overflow: inherit;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: #ffffff;
    z-index: 1001;
    box-shadow: -2px 0 20px rgba(0, 142, 118, 0.08);
    border-left: 1px solid rgba(0, 142, 118, 0.1);
    transition: margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toggle button */
#right-panel #button-toggle-right-panel {
    position: absolute;
    left: -19px;
    top: 20px;
    text-align: center;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    z-index: 10000;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 142, 118, 0.15);
    border: 2px solid #008E76;
    transform: rotate(180deg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#right-panel #button-toggle-right-panel:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 142, 118, 0.25);
    background: #008E76;
}

#right-panel #button-toggle-right-panel:hover .fa {
    background: #ffffff;
}

#right-panel.open #button-toggle-right-panel {
    transform: rotate(0deg);
    box-shadow: 0 4px 16px rgba(0, 142, 118, 0.15);
}

#right-panel.open #button-toggle-right-panel:hover {
    transform: rotate(0deg) scale(1.1);
    background: #008E76;
}

#right-panel #button-toggle-right-panel::before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

/* Content area */
#right-panel #content {
    display: flex;
    flex-direction: column;
    overflow: auto;
    overflow-x: hidden;
    padding: 0 15px;
    width: 300px;
    margin-right: -310px;
    transition: margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#right-panel.open #content {
    margin-right: 0px;
}

/* Custom scrollbar */
#right-panel #content::-webkit-scrollbar {
    width: 6px;
}

#right-panel #content::-webkit-scrollbar-track {
    background: #F3F5F7;
    border-radius: 3px;
}

#right-panel #content::-webkit-scrollbar-thumb {
    background: #008E76;
    border-radius: 3px;
}

#right-panel #content::-webkit-scrollbar-thumb:hover {
    background: #00705E;
}

/* Title and subtitle */
#right-panel-title {
    margin: 10px 4px;
    padding-bottom: 10px;
    border-bottom: 2px solid #008E76;
    color: #008E76;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

#right-panel-subtitle {
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #F3F5F7;
    border-radius: 8px;
}

/* Introduction text */
#right-panel #right-panel-intro {
    text-align: justify;
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 18px;
    padding: 16px;
    background: #F3F5F7;
    border-radius: 10px;
    border-left: 3px solid #008E76;
}

/* Chart container */
#right-panel .chart {
    min-height: 230px;
    max-height: 230px;
    width: 280px;
    display: none;
    margin: 8px 0;
    padding: 8px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 142, 118, 0.08);
    border: 1px solid rgba(0, 142, 118, 0.1);
    transition: all 0.3s ease;
}

#right-panel .chart:hover {
    box-shadow: 0 4px 12px rgba(0, 142, 118, 0.12);
}

#right-panel .chart > #place-holder {
    padding-top: 110px;
    text-align: center;
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* Legend */
#right-panel #right-panel-legend {
    font-size: 22px;
    margin: 18px 0;
    padding: 16px;
    background: #F3F5F7;
    border-radius: 10px;
}

#right-panel #right-panel-legend .tick-labels {
    font-size: 18px;
    color: #555;
    font-weight: 500;
}

#right-panel #right-panel-legend p.legend-bar {
    margin: 12px 0;
}

#right-panel #right-panel-legend p.legend-bar img {
    height: 30px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Indicator info */
#right-panel #right-panel-indicator-info {
    margin: 16px 0;
    padding: 16px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid rgba(0, 142, 118, 0.1);
}

#right-panel #right-panel-indicator-info p.legend-bar img {
    height: 26px;
}

/* Icons */
#right-panel .fa.fa-users,
#right-panel .fa.fa-user-plus {
    transform: translateY(3px);
    font-size: 20px;
    background: #008E76;
    margin-right: 6px;
    cursor: help;
    transition: all 0.2s ease;
}

#right-panel .fa.fa-users:hover,
#right-panel .fa.fa-user-plus:hover {
    background: #00705E;
    transform: translateY(1px) scale(1.1);
}

#right-panel .fa.fa-users {
    mask: url("../img/svg/users.svg");
    -webkit-mask-image: url("../img/svg/users.svg");
    mask-size: contain;
    -webkit-mask-size: contain;
}

#right-panel .fa.fa-user-plus {
    mask: url("../img/svg/users-plus.svg");
    -webkit-mask-image: url("../img/svg/users-plus.svg");
    mask-size: contain;
    -webkit-mask-size: contain;
}

#right-panel .fa.fa-angle-right {
    display: inline-block;
    vertical-align: middle;
    mask: url("../img/svg/angle-right.svg");
    -webkit-mask-image: url("../img/svg/angle-right.svg");
    mask-size: contain;
    -webkit-mask-size: contain;
    background: #008E76;
}

/* Indicators grid */
#right-panel #right-panel-indicators {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-items: center;
    text-align: center;
    justify-content: center;
    margin: 18px 0;
    padding: 16px;
    background: #F3F5F7;
    border-radius: 10px;
}

#right-panel .indicator-box {
    height: 58px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 142, 118, 0.1);
}

#right-panel .indicator-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 142, 118, 0.15);
}

#right-panel .indicator-label {
    display: none;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-top: 6px;
}

#right-panel .indicator-label.visible {
    display: block;
}

#right-panel #right-panel-indicators > p,
#right-panel #right-panel-indicators > div {
    margin: 0;
    width: auto;
    font-size: 13px;
    font-weight: 600;
}

#right-panel .indicator-box.low {
    background-image: url("../img/gauge_low.png");
    background-size: 100%;
    background-repeat: no-repeat;
}

#right-panel .indicator-box.mid {
    background-image: url("../img/gauge_mid.png");
    background-size: 100%;
    background-repeat: no-repeat;
}

#right-panel .indicator-box.hight {
    background-image: url("../img/gauge_hight.png");
    background-size: 100%;
    background-repeat: no-repeat;
}

#right-panel .best-year-match {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

#right-panel .best-year-match:hover {
    background: #F3F5F7;
}

/* Image container */
#right-panel #right-panel-img {
    margin: 8px 0;
    margin-left: 5px;
    width: 280px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 142, 118, 0.1);
}

#right-panel #right-panel-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* Stats container */
#right-panel .right-panel-stats-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 16px 0;
    padding: 16px;
    background: #F3F5F7;
    border-radius: 10px;
}

#right-panel .right-panel-stats {
    text-align: center;
    padding: 12px;
}

#right-panel .right-panel-stats .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #008E76;
    display: block;
    margin-bottom: 4px;
}

#right-panel .right-panel-stats .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toggle switch */
#right-panel #right-panel-switch-charts {
    width: 280px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    display: none;
    margin: 2px;
    padding: 0 4px 8px 8px;
    user-select: none;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(0, 142, 118, 0.1);
}

#right-panel #right-panel-switch-charts .label {
    display: inline-block;
    color: #555;
}

#right-panel #right-panel-switch-charts .switch {
    position: relative;
    display: inline-block;
    top: 3px;
    margin-left: 6px;
    margin-right: 6px;
    border: 1px solid #008E76;
    background-color: #F3F5F7;
    border-radius: 7px;
    height: 14px;
    width: 30px;
    transition: all 0.3s ease;
}

#right-panel #right-panel-switch-charts .switch span {
    position: absolute;
    top: 2px;
    left: 2px;
    display: inline-block;
    border-radius: 5px;
    height: 10px;
    width: 10px;
    background: #008E76;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 142, 118, 0.3);
}

#right-panel #right-panel-switch-charts.checked .switch {
    background-color: rgba(0, 142, 118, 0.1);
    border-color: #008E76;
}

#right-panel #right-panel-switch-charts.checked .switch span {
    transform: translateX(16px);
}

#right-panel #right-panel-switch-charts:focus,
#right-panel #right-panel-switch-charts:hover {
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 142, 118, 0.1);
}

#right-panel #right-panel-switch-charts:hover .switch {
    border-color: #00705E;
}

/* Loading state */
#right-panel.loading {
    opacity: 0.6;
}

#right-panel.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #F3F5F7;
    border-top: 4px solid #008E76;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #right-panel #content {
        width: 300px;
        margin-right: -310px;
        padding: 18px 16px;
    }

    #right-panel-title {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    #right-panel {
        position: fixed;
        right: 0;
        top: 85px;
        bottom: 0;
        width: auto;
    }

    #right-panel #content {
        width: 280px;
        margin-right: -290px;
    }
}
