/* General Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f9f9fb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
    overflow-x: hidden;
}

/* Player Info Section */
.playerInfo {
    background-color: #f9f9fb;
    border: 2px solid #d4a017;
    border-radius: 15px;
    padding: 25px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    margin: 40px auto;
}

.playerInfo h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 15px;
    border-bottom: 2px solid #d4a017;
    padding-bottom: 5px;
    display: inline-block;
}

.playerInfo .playerTag {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bfbfbf;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.1);
}

.playerInfo .playerTag:focus {
    border-color: #d4a017;
    box-shadow: 0px 0px 6px rgba(212, 160, 23, 0.4);
}

.playerInfo .fetchPlayer {
    background-color: #d4a017;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
}

.playerInfo .fetchPlayer:hover {
    background-color: #b38e14;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

/* Container Layout */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
}

/* Card Styles */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Card Header */
.card-header {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Content Items */
.content-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
}

.content-item:last-child {
    margin-bottom: 0;
}

.content-item-label {
    font-size: 13px;
    color: #666666;
    font-weight: 500;
}

.content-item-value {
    font-size: 13px;
    color: #333333;
    font-weight: 600;
}

/* Card Section and Content */
.card-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-content {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.text-index {
    font-weight: 600;
    color: #007bff;
    margin-right: 8px;
}

.content-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
    position: relative;  /* Added this */
    padding-bottom: 30px; 
}

.content-info-hidden {
    margin-top: 12px;
    padding: 12px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #eee;
    display: none;
    width: 100%;
}

/* Content Image */
.content-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* Label Icons Styles */
.special-card {
    padding: 15px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.special-card>div {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.label-icon {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
}

.label-icon:hover {
    background: #f1f1f4;
}

.label-icon .content-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin: 0;
}

.label-icon .text-primary {
    font-size: 14px;
    margin: 0;
}

/* Show More Button */
.showmore {
    padding: 6px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    position: absolute;  /* Added this */
    bottom: 0;          /* Added this */
    right: 0; 
}

.showmore:hover {
    background-color: #0056b3;
}

/* Text Styles */
.text-primary {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin: 0 10px;
}

.text-secondary {
    font-size: 12px;
    color: #666666;
    margin: 0 10px;
}

.text-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 10px;
}

/* Troops Section Styles */
.troops-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.village-troops {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.village-troops h2 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.troop-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.troop-card {
    background: white;
    border-radius: 8px;
    padding: 10px;
    width: calc(20% - 10px);
    min-width: 100px;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.troop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.troop-image {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.troop-image img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.troop-info {
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

.troop-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
}

.troop-level {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

/* Village distinction */
.village-troops:nth-child(1) {
    border-left: 4px solid #4CAF50;
}

.village-troops:nth-child(2) {
    border-left: 4px solid #2196F3;
}

.troop-info img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.troop-info .troop-icons {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin: 5px 0;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .troop-card {
        width: calc(25% - 10px);
    }
}

@media (max-width: 992px) {
    .troop-card {
        width: calc(33.33% - 10px);
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .playerInfo {
        padding: 15px;
        margin: 20px auto;
    }

    .card-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .content-info {
        width: 100%;
        justify-content: flex-start;
        padding-bottom: 35px;
    }

    .label-icon {
        width: 100%;
        min-width: 160px;
    }

    .troop-card {
        width: calc(50% - 10px);
        min-width: 90px;
    }

    .troop-image img {
        width: 40px;
        height: 40px;
    }

    .content-item {
        padding: 6px 10px;
    }

    .content-item-label,
    .content-item-value {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 0 5px;
    }

    .playerInfo {
        width: 95%;
        padding: 12px;
    }

    .playerInfo h1 {
        font-size: 20px;
    }

    .card {
        padding: 12px;
    }

    .card-content {
        padding: 10px;
        gap: 10px;
    }

    .content-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .troop-grid {
        gap: 8px;
    }

    .troop-card {
        width: calc(33.33% - 8px);
        min-width: 70px;
        padding: 6px;
    }

    .troop-image img,
    .troop-info img,
    .troop-info .troop-icons {
        width: 40px;
        height: 40px;
    }

    .troop-name {
        font-size: 10px;
    }

    .troop-level {
        font-size: 9px;
    }

    .text-primary {
        font-size: 12px;
        margin: 0 5px;
    }

    .text-secondary {
        font-size: 11px;
        margin: 0 5px;
    }

    .text-badge {
        font-size: 10px;
        padding: 3px 6px;
        margin: 0 5px;
    }

    .label-icon {
        padding: 6px 10px;
    }

    .label-icon .content-image {
        width: 30px;
        height: 30px;
    }

    .card-header {
        font-size: 14px;
    }

    .village-troops h2 {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .troop-card {
        width: calc(50% - 8px);
    }

    .content-info {
        gap: 5px;
    }

    .label-icon {
        min-width: 140px;
    }
}
