/**
                          ,
   ,-.       _,---._ __  / \
  /  )    .-'       `./ /   \
 (  (   ,'            `/    /|
  \  `-"             \'\   / |
   `.              ,  \ \ /  |
    /`.          ,'-`----Y   |
   (            ;        |   '
   |  ,-.    ,-'         |  /
   |  | (   |            | /
   )  |  \  `.___________|/
   `--'   `--'
    I'm aitji (also known as **Suriya Inchoo**)
    the host of the following websites
    * https://aitji.is-a.dev
    * https://pr-thatako.ddns.net or http://pr.thatako.ac.th

    If you're interested in contributing to the project,
    you're welcome to reach out to me on Discord my username is "aitji".  
    You can also submit an inquiry through the support ticket system available at https://aitji.is-a.dev/discord

    Further information about the project and licensing
    can be found at "https://thatako-council.com/LICENSE"

    Sincerely,  
    Suriya Inchoo (aitji)
*/

:root {
    --ok-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 10px;
    --transition-normal: all 0.3s ease;
}

body {
    background-color: #f8f9fa;
}

.containerEl {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h2 {
    margin: 0;
    font-weight: 600;
}

.sync-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
    display: flex;
    gap: 15px;
}

#areaTabs {
    background-color: #fff;
    padding: 0 20px;
    border: none;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--dark-color);
    font-weight: 500;
    padding: 15px 20px;
    position: relative;
    transition: all 0.3s ease;
}

.search-container {
    display: flex;
    margin-bottom: 20px;
    position: relative;
}

.search-container input {
    border-radius: 50px;
    padding-left: 40px;
    border: 1px solid #ddd;
}

.search-container .search-icon {
    position: absolute;
    left: 15px;
    top: 10px;
    color: #aaa;
}

.search-container .clear-btn {
    position: absolute;
    right: 15px;
    top: 8px;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 3px solid var(--primary-color);
}

.tab-content {
    background-color: #fff;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.area-entry {
    animation: fadeIn 0.5s ease forwards;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid #ddd;
}

.area-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.area-entry.good {
    border-left-color: var(--ok-color);
}

.area-entry.warning {
    border-left-color: var(--warning-color);
}

.area-entry.bad {
    border-left-color: var(--danger-color);
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.header-info h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.timestamp-badge {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: normal;
    padding-left: 10px;
}

.score-summary {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.refresh-button {
    cursor: default;
}

.refresh-button:disabled {
    cursor: progress;
}

.scoring-details {
    background-color: rgba(236, 240, 241, 0.5);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.score-section {
    margin-bottom: 20px;
}

.score-section h5 {
    font-size: 1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.score-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.score-option {
    background-color: #e9ecef;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: default;
}

.score-option.selected {
    background-color: var(--primary-color);
    color: white;
}

.empty-state {
    padding: 40px 20px;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin: 20px 0;
}

.empty-state i {
    color: #dee2e6;
}

.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.area-statistics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1 1 calc(50% - 10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background-color: white;
    min-width: 140px;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    text-align: left;
}

.stat-card .stat-content {
    flex: 1;
}

.stat-card.primary .stat-icon {
    color: var(--primary-color);
}

.stat-card.success .stat-icon {
    color: var(--ok-color);
}

.stat-card.warning .stat-icon {
    color: var(--warning-color);
}

.stat-card.danger .stat-icon {
    color: var(--danger-color);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--primary-color);
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2px 0;
    line-height: 1.2;
}

.stat-card .label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.score-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-category {
    background-color: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.category-header {
    /* display: flex; */
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    margin-bottom: 5px;
}

.category-header i {
    color: var(--primary-color);
    margin-right: 8px;
}

.category-score {
    font-weight: 700;
    color: var(--dark-color);
}

.category-description {
    font-size: 0.85rem;
    color: #6c757d;
}

.stat-card.primary {
    border-top: 3px solid var(--primary-color);
}

.stat-card.success {
    border-top: 3px solid var(--ok-color);
}

.stat-card.warning {
    border-top: 3px solid var(--warning-color);
}

.stat-card.danger {
    border-top: 3px solid var(--danger-color);
}

.evaluator-info {
    font-size: 0.85rem;
    color: #6c757d;
    text-align: right;
    margin-top: 5px;
}

.media-preview {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 15px 0;
    background-color: #f8f9fa;
}

.media-thumbnail {
    width: 360px;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.iframe-wrapper {
    width: 100%;
    height: 100%;
    transform: scale(1.4);
    pointer-events: none;
}

.embed-responsive {
    width: 100%;
    height: 100%;
    border: none;
}

.additional-info {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 12px;
    margin: 15px 0;
}

.additional-header {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.additional-content {
    font-size: 0.9rem;
    padding: 5px;
    padding-left: 8px;
    border-radius: 3px;
    color: #555;
    background-color: #edeff1;
}

.refresh-button {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.refresh-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.refresh-button i {
    font-size: 0.8rem;
}

.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Score chart */
.score-chart {
    background-color: #e9ecef;
    border-radius: 5px;
    margin-bottom: 5px;
    overflow: hidden;
    height: 8px;
    margin: 8px 0;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.score-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #3498db 0%, var(--ok-color) 100%);
}

.good .score-fill {
    background: linear-gradient(90deg, var(--ok-color), #27ae60);
}

.warning .score-fill {
    background: linear-gradient(90deg, var(--warning-color), #d35400);
}

.bad .score-fill {
    background: linear-gradient(90deg, var(--danger-color), #c0392b);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.toast {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.custom-toast {
    background-color: white;
    color: var(--dark-color);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 350px;
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.custom-toast.success {
    border-left: 4px solid var(--ok-color);
}

.custom-toast.error {
    border-left: 4px solid var(--danger-color);
}

.custom-toast.info {
    border-left: 4px solid var(--primary-color);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

.nav-item {
    overflow: hidden;
}

@media (max-width: 991px) {
    .header {
        padding: 15px;
    }

    .header h2 {
        font-size: 1.3rem;
    }

    .sync-info {
        font-size: 0.8rem;
    }

    .stat-card {
        flex: 1 1 calc(50% - 10px);
    }

    .stat-card .value {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header>div {
        width: 100%;
    }

    .sync-info {
        flex-direction: column;
        gap: 5px;
    }

    .refresh-button {
        width: 100%;
        justify-content: center;
    }

    .stat-card {
        flex: 1 1 100%;
    }

    .area-entry {
        padding: 12px;
    }

    .header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .timestamp-badge {
        align-self: flex-start;
    }

    .nav-tabs .nav-link {
        padding: 10px;
        font-size: 0.85rem;
    }

    .score-categories {
        gap: 8px;
    }
}

.nav-tabs .nav-item {
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.total-stats-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

#search-input {
    height: 50px;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    border-color: #e9ecef;
    transition: var(--transition-normal);
}

#search-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
    border-color: var(--primary-color);
}

@media (max-width: 360px) {
    .header h2 {
        font-size: 1.1rem;
    }

    .nav-tabs .nav-link {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
}