/*
 * components.css - Reusable UI Components
 *
 * Purpose: All reusable UI component styles including:
 *   - Image components (logos, medals, flags)
 *   - Score containers and boxes
 *   - Stat display components
 *   - Message/notification components
 *   - Card/article components
 *   - Chart containers
 *   - Modal dialogs
 *   - Leaderboard widget
 *   - Star/leaf rating widget
 *
 * Used across: Home, corporates, analytics, leaderboard, input section
 */

/* ==========================================================================
   Image Components
   ========================================================================== */

.company-logo {
    max-height: 100px;
    max-width: 100px;
    vertical-align: middle;
}

.company-logo-small {
    height: 50px;
    vertical-align: middle;
}

.company-logo-medium {
    height: 75px;
    vertical-align: middle;
}

.medal-image {
    height: 50px;
}

.flag-icon {
    display: block;
    margin: 0 auto;
    height: 40px;
    width: auto;
}

/* Image containers */
.image-container-30 {
    width: 30%;
}

.image-container-50 {
    width: 50%;
}

.image-container-70 {
    width: 70%;
}

/* External link images */
.external-link-img {
    border: 0px;
    height: 36px;
}

/* ==========================================================================
   Score Components
   ========================================================================== */

.score-container {
    display: flex;
    align-items: center;
    height: 100px;
}

.score-box {
    background: lightgrey;
    padding: 1em;
    border-radius: 4px;
}

/* ==========================================================================
   Stat Components
   ========================================================================== */

.stat-value {
    font-size: 2em;
    font-weight: bold;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

.stats-header {
    color: white;
    background: #2ebaae;
}

/* ==========================================================================
   Message Components
   ========================================================================== */

.message-error {
    font-weight: 600;
    color: red;
    font-size: 90%;
}

.message-success {
    font-weight: 600;
    color: green;
    font-size: 90%;
}

.message-info {
    color: blue;
    font-size: 90%;
}

/* Info status messages */
.info-status-error {
    color: red;
    font-size: 50%;
}

.info-status-warning {
    color: orange;
    font-size: 50%;
}

.info-status-success {
    color: green;
    font-size: 50%;
}

/* Text color utilities (no font-weight) */
.text-success {
    color: green;
}

.text-error {
    color: red;
}

.text-warning {
    color: orange;
}

/* Icon colors */
.icon-success {
    color: green;
}

.icon-error {
    color: red;
}

/* ==========================================================================
   Card/Article Components
   ========================================================================== */

.card-grey {
    background: lightgrey;
}

.card-light {
    background: #f8f9fa;
}

/* ==========================================================================
   Navigation Components
   ========================================================================== */

.nav-link-bold {
    font-weight: bold;
}

/* ==========================================================================
   Chart Containers
   ========================================================================== */

.chart-container {
    width: 100%;
    min-height: 400px;
}

.chart-container-small {
    width: 100%;
    min-height: 300px;
}

/* ==========================================================================
   Modal Component (merged from modal.css)
   ========================================================================== */

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
}

/* Modal container */
.modal {
    background-color: #ffffff;
    border-radius: 0;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin: auto;
}

.modal-dialog-centered {
    min-height: calc(100% - 2em);
    display: flex;
    align-items: center;
}

/* Modal header */
.modal-header {
    padding: 1.5em;
    border-bottom: solid 1px rgba(160, 160, 160, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    margin: 0;
    font-size: 1.25em;
    font-weight: 700;
    color: #3c3b3b;
}

.modal-close,
.btn-close {
    background: rgba(160, 160, 160, 0.075);
    border: solid 1px rgba(160, 160, 160, 0.3);
    border-radius: 50%;
    font-size: 1.75em;
    line-height: 0.9;
    font-weight: 300;
    color: #3c3b3b;
    cursor: pointer;
    padding: 0;
    width: 1.2em;
    height: 1.2em;
    min-width: 1.2em;
    min-height: 1.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    flex-shrink: 0;
    text-align: center;
    letter-spacing: 0;
}

.modal-close:hover,
.btn-close:hover {
    background: rgba(160, 160, 160, 0.15);
    border-color: rgba(160, 160, 160, 0.5);
}

/* Modal body */
.modal-body {
    padding: 1.5em;
    overflow-y: auto;
    flex: 1;
}

/* Modal footer */
.modal-footer {
    padding: 1.5em;
    border-top: solid 1px rgba(160, 160, 160, 0.3);
    display: flex;
    gap: 0.5em;
    justify-content: flex-end;
}

/* Form check (radio/checkbox) */
.form-check {
    display: block;
    margin-bottom: 1em;
}

.form-check input[type="radio"],
.form-check input[type="checkbox"] {
    margin-right: 0.5em;
}

.form-check label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Modal buttons */
.btn {
    appearance: none;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    background-color: transparent;
    border-radius: 0;
    border: 0;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
    height: 3.5em;
    line-height: 3.5em;
    padding: 0 2em;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: #2ebaae;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #3ec9bc;
}

.btn-secondary {
    background-color: rgba(160, 160, 160, 0.075);
    color: #3c3b3b !important;
}

.btn-secondary:hover {
    background-color: rgba(160, 160, 160, 0.15);
}

/* Modal responsive */
@media screen and (max-width: 736px) {
    .modal {
        max-width: 100%;
        margin: 0;
    }

    .modal-overlay.active {
        padding: 0;
        align-items: stretch;
    }
}

/* ==========================================================================
   Leaderboard Component (merged from leaderboard.css)
   ========================================================================== */

.lboard_section {
    width: 500px;
    height: 400px;
    margin: 100px auto 0;
    background: #646464;
    padding: 25px 40px;
    position: relative;
    border-radius: 5px;
}

.lb_left .lboard_tabs ul {
    display: flex;
    padding-left: 1rem;
}

.lb_left .lboard_tabs ul li a {
    margin-right: 50px;
    font-size: 18px;
    font-weight: 600;
    color: #2ebaae;
    cursor: pointer;
}

.lb_left .lboard_tabs ul li {
    font-size: 18px;
    font-weight: 600;
    color: #2ebaae;
    margin-right: 1rem;
    list-style: none;
    cursor: pointer;
}

.lb_left .lboard_tabs ul li:hover,
.lb_left .lboard_tabs ul li.active {
    color: #fff;
}

.lb_right .lboard_item {
    padding: 25px;
}

.lb_right .lboard_mem {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #2ebaae;
}

.lb_right .lboard_mem:first-child {
    padding-top: 0;
}

.lb_right .lboard_mem:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.lb_right .lboard_mem .img {
    width: 50px;
}

.lb_right .lboard_mem img {
    display: flex;
    width: 100%;
}

.lb_right .lboard_mem .name_bar {
    margin: 0 20px;
    width: calc(100% - 150px);
}

.lb_right .lboard_mem .name_bar p {
    color: #3a3d51;
}

.lb_right .lboard_mem .name_bar p span {
    margin-right: 5px;
}

.lb_right .lboard_mem .points {
    width: 100px;
    color: #3a3d51;
}

.lb_right .lboard_mem .name_bar .bar_wrap {
    width: 100%;
    height: 5px;
    background: #565e0e;
    margin-top: 5px;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.lb_right .lboard_mem .name_bar .bar_wrap .inner_bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 5px;
    background: #fff;
    border-radius: 5px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
}

.lb_container {
    display: flex;
    width: 100%;
}

.lb_left {
    width: 100%;
    background: #646464;
    margin: 0rem 2rem 2rem 0rem;
    border-radius: 5px;
}

.lb_right {
    width: 100%;
    height: 100%;
    background: #2ebaae;
    margin-left: -97%;
    margin-top: 2rem;
    border-radius: 5px;
}

.lb_corporates img {
    width: 30px;
}

/* ==========================================================================
   Star/Leaf Rating Component (merged from star_rating.css)
   ========================================================================== */

:root {
    --star-size: 30px;
    --star-color: rgba(63, 61, 61, 0.185);
    --star-background: rgb(22, 107, 22);
    --fa_star-background: rgb(22, 107, 22);
}

.Stars {
    --percent: calc(var(--rating) / 5 * 100%);
    display: inline-block;
    font-size: var(--star-size);
    font-family: Times;
    line-height: 1;
}

.Stars::before {
    content: "☘☘☘☘☘";
    letter-spacing: 3px;
    background: linear-gradient(90deg, var(--star-background) var(--percent), var(--star-color) var(--percent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fa_Stars {
    content: "☘️☘️☘️☘️☘️";
    --percent: calc(var(--fa_rating) / 5 * 100%);
    display: inline-block;
}

.fa_Stars::before {
    background: linear-gradient(90deg, var(--star-background) var(--percent), var(--star-color) var(--percent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
