/* =========================================== */
/*                Services                     */
/* =========================================== */

.history-text {
    font-size: 0.875rem;
    line-height: 1.5em;
    font-style: italic;
    color: var(--bodyTextColor);
    padding: 0 var(--sectionPadding);
    text-align: center;
}

/* --- Top 3 cards --- */
.top-players { margin-top: 8px; }
.top-player-entry { margin-bottom: 4px; font-weight: bold; color: #1976d2; }
.top-player-entry span:first-child { text-decoration: underline; }

/* Movement arrows */
.stat-movement { display: inline-block; margin-left: 10px; font-size: 1.2rem; vertical-align: middle; transition: transform 0.5s ease; }
.stat-movement.up { color: green; }
.stat-movement.down { color: red; }
.stat-movement.same { color: gray; }

/* Cards layout */
.cs-card-group { display: flex; flex-wrap: wrap; gap: 16px; padding: 0; list-style: none; }
.cs-item { flex: 1 1 280px; background: #fff; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: transform 0.3s ease; }
.cs-item:hover { transform: translateY(-4px); box-shadow: 0 8px 14px rgba(0,0,0,0.15); }
.cs-item a.cs-link { display: block; text-decoration: none; color: #000; padding: 16px; }
.cs-item h3 { font-size: 1.2rem; margin-bottom: 6px; }
.cs-item p.cs-item-text { font-size: 0.95rem; color: #555; margin-bottom: 8px; }

/* --- Modal --- */
.modal { display: none; position: fixed; z-index: 1000; left:0; top:0; width:100%; height:100%; background: rgba(0,0,0,0.6); overflow-y: auto; padding: 40px 10px; box-sizing: border-box; }
.modal-content { max-width: 600px; margin: 0 auto; background: #fff; border-radius: 12px; overflow: hidden; transform: translateY(-30px); opacity: 0; transition: all 0.3s ease; }
.modal-content.show { transform: translateY(0); opacity: 1; }
.modal-content.hide { transform: translateY(30px); opacity: 0; }
.modal-header { padding: 16px; background: #1976d2; color: #fff; font-size: 1.2rem; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 16px; overflow-x: auto; }
.modal-body table { width: 100%; border-collapse: collapse; }
.modal-body th, .modal-body td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; font-size: 0.95rem; }
.modal-body tr.gold td { background: #fff8e1; font-weight: bold; }
.modal-body tr.silver td { background: #f1f1f1; font-weight: bold; }
.modal-body tr.bronze td { background: #fff3e0; font-weight: bold; }
.close { cursor: pointer; font-size: 1.3rem; font-weight: bold; }

/* Responsive tweaks */
@media (max-width: 768px) {
  .cs-card-group { flex-direction: column; }
  .cs-item { flex: 1 1 auto; }
  .modal-content { width: 95%; padding-bottom: 10px; margin-top: 5rem;}
  .modal-body table, .modal-body th, .modal-body td { font-size: 0.9rem; }
}

/* Cascade animation for leaderboard rows */
#leaderboardTable tbody tr { opacity: 0; transform: translateY(10px); transition: all 0.3s ease; }
#leaderboardTable tbody tr.show { opacity: 1; transform: translateY(0); }

/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
    #services-342 { padding: var(--sectionPadding); }
    #services-342 .cs-container {
        width: 100%;
        max-width: 90%;
        margin: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: clamp(3rem, 6vw, 4rem);
    }
    #services-342 .cs-content {
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #services-342 .cs-card-group {
        width: 100%;
        padding: 0;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        gap: clamp(1rem, 1.6vw, 1.25rem);
    }
    #services-342 .cs-item {
        list-style: none;
        width: 100%;
        max-width: 31.25rem;
        border-radius: 0.5rem;
        position: relative;
        z-index: 1;
        transition: box-shadow 0.3s, transform 0.3s;
    }
    #services-342 .cs-item:hover { 
        box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px; 
        transform: translateY(-0.4375rem); 
    }
    #services-342 .cs-item:hover .cs-picture img {
        opacity: 0.3;
        transform: scale(1.1);
    }
    #services-342 .cs-item:hover .cs-h3 { color: var(--primaryLight); }
    #services-342 .cs-item:before {
        content: "";
        width: 100%;
        height: 100%;
        border-radius: 0.5rem;
        border: 1px solid #e8e8e8;
        box-sizing: border-box;
        background: transparent;
        opacity: 1;
        position: absolute;
        display: block;
        top: 0;
        left: 0;
        z-index: -1;
    }
    #services-342 .cs-link {
        text-decoration: none;
        padding-bottom: clamp(1rem, 2.2vw, 1.5rem);
        display: block;
    }
    #services-342 .cs-picture {
        width: 100%;
        height: 15rem;
        margin-bottom: clamp(1rem, 2.2vw, 1.5rem);
        border-radius: 0.5rem 0.5rem 0 0;
        background-color: var(--primaryLight);
        overflow: hidden;
        display: block;
        position: relative;
        z-index: 10;
    }
    #services-342 .cs-picture img {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
        object-fit: cover;
        transition: transform 0.6s, opacity 0.3s;
    }
    #services-342 .cs-h3 {
        font-size: clamp(1.25rem, 3vw, 1.5625rem);
        line-height: 1.2em;
        font-weight: 700;
        color: var(--headerColor);
        margin: 0 0 0.75rem 0;
        padding: 0 clamp(1rem, 2vw, 1.5rem);
        transition: color 0.3s;
    }
    #services-342 .cs-item-text {
        font-size: clamp(0.875rem, 1.5vw, 1rem);
        line-height: 1.5em;
        color: var(--bodyTextColor);
        margin: 0;
        padding: 0 clamp(1rem, 2.2vw, 1.5rem);
    }
}

/* Tablet - 768px */
@media only screen and (min-width: 48rem) {
    #services-342 .cs-card-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
    #services-342 .cs-item {
        width: clamp(31.85%, 30.5vw, 32.28%);
    }
}

/* Modal Styling */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); 
}
.modal-content {
    background-color: #f9f9f9;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.3s ease;
}
.modal-content.show { opacity:1; transform:translateY(0); }
.modal-content.hide { opacity:0; transform:translateY(50px); }

.modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal .close:hover, .modal .close:focus { color: black; }

#searchInput {
    width: 100%;
    padding: 8px 12px;
    margin: 10px 0 20px 0;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

#leaderboardTable {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}
#leaderboardTable th, #leaderboardTable td {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
}

tr.gold { background-color: #ffd7003d; }
tr.silver { background-color: #c0c0c03d; }
tr.bronze { background-color: #cd7f323d; }

/* Cascade animation for rows */
#leaderboardTable tbody tr { opacity:0; transform:translateY(20px); transition: all 0.3s ease; }
#leaderboardTable tbody tr.show { opacity:1; transform:translateY(0); }


/* --------------------------
   History Text
-------------------------- */
.history-text {
    font-size: 0.875rem;
    line-height: 1.5em;
    font-style: italic;
    color: var(--bodyTextColor);
    padding: 0 var(--sectionPadding);
    text-align: center;
    margin-bottom: 1rem;
}

/* --------------------------
   Top 3 Cards
-------------------------- */
.top-players { margin-top: 8px; }
.top-player-entry { 
    margin-bottom: 4px; 
    font-weight: bold; 
    color: #1976d2; 
}
.top-player-entry span:first-child { text-decoration: underline; }

/* Movement arrows */
.stat-movement { 
    display: inline-block; 
    margin-left: 10px; 
    font-size: 1.2rem; 
    vertical-align: middle; 
    transition: transform 0.5s ease; 
}
.stat-movement.up { color: green; }
.stat-movement.down { color: red; }
.stat-movement.same { color: gray; }

/* --------------------------
   Cards Layout
-------------------------- */
.cs-card-group { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 16px; 
    padding: 0; 
    list-style: none; 
}
.cs-item { 
    flex: 1 1 32%; 
    background: #fff; 
    border-radius: 12px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cs-item:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 14px rgba(0,0,0,0.15); 
}
.cs-item a.cs-link { 
    display: block; 
    text-decoration: none; 
    color: #000; 
    padding: 16px; 
}
.cs-item h3 { 
    font-size: 1.2rem; 
    margin-bottom: 6px; 
}
.cs-item p.cs-item-text { 
    font-size: 0.95rem; 
    color: #555; 
    margin-bottom: 8px; 
}

/* --------------------------
   Modal Styles
-------------------------- */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left:0; top:0; 
    width:100%; 
    height:100%; 
    background: rgba(0,0,0,0.6); 
    overflow-y: auto; 
    padding: 40px 10px; 
    box-sizing: border-box; 
}
.modal-content { 
    max-width: 600px; 
    margin: 5rem auto; 
    background: #fff; 
    border-radius: 12px; 
    overflow: hidden; 
    transform: translateY(-30px); 
    opacity: 0; 
    transition: all 0.3s ease; 
}
.modal-content.show { 
    transform: translateY(0); 
    opacity: 1; 
}
.modal-header { 
    padding: 16px; 
    background: #1976d2; 
    color: #fff; 
    font-size: 1.2rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.modal-body { 
    padding: 16px; 
    overflow-x: auto; 
}
.modal-body table { 
    width: 100%; 
    border-collapse: collapse; 
}
.modal-body th, .modal-body td { 
    padding: 8px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
    font-size: 0.95rem; 
}
.modal-body tr.gold td { background: #fff8e1; font-weight: bold; }
.modal-body tr.silver td { background: #f1f1f1; font-weight: bold; }
.modal-body tr.bronze td { background: #fff3e0; font-weight: bold; }
.close { 
    cursor: pointer; 
    font-size: 1.3rem; 
    font-weight: bold; 
}

/* --------------------------
   Responsive Tweaks
-------------------------- */
@media (max-width: 768px) {
  .cs-card-group { flex-direction: column; }
  .cs-item { flex: 1 1 auto; }
  .modal-content { width: 95%; padding-bottom: 10px; }
  .modal-body table, .modal-body th, .modal-body td { font-size: 0.9rem; }
}

/* Cascade animation for leaderboard rows */
#leaderboardTable tbody tr { 
    opacity: 0; 
    transform: translateY(10px); 
    transition: all 0.3s ease; 
}
#leaderboardTable tbody tr.show { 
    opacity: 1; 
    transform: translateY(0); 
}

/* --------------------------
   Modern Mobile Card Styles
-------------------------- */
@media only screen and (max-width: 768px) {
    #services-342 .cs-card-group {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    #services-342 .cs-item {
        width: 100%;
        max-width: 31.25rem;
        border-radius: 12px;
        position: relative;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    #services-342 .cs-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 20px rgba(0,0,0,0.15);
    }
    #services-342 .cs-item h3 {
        font-size: 1.25rem;
    }
    #services-342 .cs-item-text {
        font-size: 0.95rem;
    }
}

/* --------------------------
   Optional Hover Effect for Top Players
-------------------------- */
.top-player-entry:hover {
    text-decoration: underline;
    cursor: pointer;
}
