/* General body styling */
body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #1e1e1e; /* Dark industrial background */
    color: #f0f0f0;
    margin: 0;
    padding: 0;
}

/* Header styling */
header {
    background-color: #333;
    color: #fff;
    padding: 1em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2.2em;
    font-weight: bold;
    margin: 0;
}

/* Main Menu */
/* Main Menu */
#mainMenu {
    position: relative;
    height: 100vh;
    background: linear-gradient(
        rgba(0, 0, 0, 0.6), 
        rgba(0, 0, 0, 0.6)
    ), url('your-background-image.jpg') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#mainMenu h1 {
    color: #ffa500;
    font-size: 4em;
    margin-bottom: 0.5em;
    text-shadow: 0 0 10px rgba(255, 165, 0, 0.7);
}

#mainMenu button {
    font-size: 1.5em;
    background-color: transparent;
    color: #fff;
    padding: 15px 30px;
    margin-top: 1em;
    border: 2px solid #ffa500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

#mainMenu button:hover {
    background-color: #ffa500;
    color: #1e1e1e;
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.7);
}

/* Dashboard styling */
#dashboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 2em;
}

#dashboard .dashboard-item {
    background: linear-gradient(135deg, #333, #1e1e1e);
    padding: 20px;
    border-radius: 15px;
    width: 220px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

#dashboard .dashboard-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.6);
}

#dashboard .dashboard-item i {
    font-size: 2.5em;
    color: #ffa500;
    margin-bottom: 10px;
}

#dashboard .dashboard-item strong {
    display: block;
    font-size: 1.2em;
    margin-bottom: 5px;
}

#dashboard .dashboard-item span {
    font-size: 1.4em;
}

/* Button styling */
button {
    padding: 12px 24px;
    font-size: 1.1em;
    cursor: pointer;
    background-color: #444;
    color: #fff;
    border: 2px solid #666;
    border-radius: 8px;
    transition: all 0.3s;
}

button:hover {
    background-color: #ffa500;
    color: #1e1e1e;
    border-color: #ffa500;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.7);
}

/* General styling for header and main content */
header {
    background-color: #1e1e1e;
    padding: 1em;
    text-align: center;
}

main {
    padding: 2em;
}

/* Update controls styling */
#controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 1em;
}

/* Position for gacha button */
#gachaButton {
    position: fixed;
    top: 20px;
    right: 20px;
}

#gachaButton button {
    font-size: 1em;
    background-color: #ffa500;
    color: #1e1e1e;
    border: 2px solid #ffa500;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

#gachaButton button:hover {
    background-color: #333;
    color: #ffa500;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.7);
}

/* Additional styles for a fancy look */
#mainMenu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 165, 0, 0.2), transparent 70%);
    z-index: -1;
    animation: pulsate 5s infinite;
}

@keyframes pulsate {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}
/* Gacha Room and Engineer Collection styling */
#gachaRoom {
    background-color: #333;
    padding: 20px;
    color: #fff;
}

#gachaRoom h2 {
    color: #ffa500;
}

#gachaRoom button {
    background-color: #ffa500;
    color: #1e1e1e;
    border: none;
    margin: 10px;
    padding: 15px 25px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#gachaRoom button:hover {
    background-color: #333;
    color: #ffa500;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.7);
}

.gacha-animation-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

/* Engineer Collection styling */
#engineerCollection {
    background-color: #282828;
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    margin: 20px auto;
    color: #fff;
}

#engineerCollection h3 {
    color: #ffa500;
}

#engineerList {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

#engineerList .engineer-card {
    margin: 10px;
}

/* Drill container styling */
#drillsContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 2em;
}

.drill {
    background-color: #444;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    width: 250px;
}

.drill h3 {
    color: #ffa500;
}

.drill button {
    margin-top: 10px;
    background-color: #555;
    border: 2px solid #777;
}

.drill button:hover {
    background-color: #ffa500;
    color: #ffffff;
}

/* Position for gacha button */
#gachaButton {
    position: fixed;
    top: 20px;
    right: 20px;
}

#gachaButton button {
    font-size: 1em;
    background-color: #ffa500;
    color: #1e1e1e;
    border: 2px solid #ffa500;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

#gachaButton button:hover {
    background-color: #333;
    color: #ffa500;
}

/* Gacha Results Container */
#gachaResults {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 20px;
    background-color: #333;
    border-radius: 8px;
    margin-top: 20px;
}

/* Ensure consistent box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Engineer card styles */
.engineer-card {
    position: relative;
    width: 150px;
    height: 230px;
    perspective: 1000px;
    margin: 10px;
    animation: cardEntrance 0.5s ease-in-out;
}

.engineer-card .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.engineer-card .card-front,
.engineer-card .card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0; /* Ensure no padding */
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Card front styles with background image */
.engineer-card .card-front {
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Remove position: relative; */
}

/* Set background images for card fronts based on class */
.engineer-card.C .card-front { background-image: url('Images/C.png'); }
.engineer-card.R .card-front { background-image: url('Images/R.png'); }
.engineer-card.SR .card-front { background-image: url('Images/SR.png'); }
.engineer-card.SSR .card-front { background-image: url('Images/SSR.png'); }
.engineer-card.UR .card-front { background-image: url('Images/UR.png'); }

/* Card back styles */
.engineer-card .card-back {
    transform: rotateY(180deg);
    position: absolute;
    top: 0;
    left: 0;
    /* Remove padding: 10px; */
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #1e1e1e;
}

/* Set background colors for card backs based on class */
.engineer-card.C .card-back { background-color: #7e7e7e; }
.engineer-card.R .card-back { background-color: #2b6dff; }
.engineer-card.SR .card-back { background-color: #8a2be2; }
.engineer-card.SSR .card-back { background-color: #ffa500; }
.engineer-card.UR .card-back { background-color: #ff2b2b; }

/* Overlay to improve text readability on card back */
.engineer-card .card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.engineer-card .card-back > * {
    position: relative;
    z-index: 2;
}

/* Text styling for readability */
.engineer-card .card-back h4,
.engineer-card .card-back p,
.engineer-card .card-back button {
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Card content styling */
.engineer-card .card-back .engineer-image {
    width: 80%;
    height: 80px; /* Adjusted height */
    background-color: rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
    border-radius: 5px;
}

.engineer-card .card-back h4,
.engineer-card .card-back p {
    margin: 2px 0;
    font-size: 0.9em;
    line-height: 1.2em;
}

.engineer-card .card-back button {
    margin-top: 5px;
    background-color: #555;
    border: 2px solid #777;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.engineer-card .card-back button:hover {
    background-color: #ffa500;
    color: #1e1e1e;
    border-color: #ffa500;
}

/* Flip effect on hover */
.engineer-card:hover .card-inner {
    transform: rotateY(180deg);
}

/* Animation for card entrance */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glowing effect for high rarity cards on card back */
.engineer-card.SSR .card-back,
.engineer-card.UR .card-back {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
}


/* Overlay to improve text readability */
.engineer-card .card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Adjust opacity as needed */
    z-index: 1;
}

/* Ensure the content is above the overlay */
.engineer-card .card-back > * {
    position: relative;
    z-index: 2;
}

/* Modal container */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background: rgba(0, 0, 0, 0.8);
}

/* Modal content */
.modal-content {
    background-color: #1e1e1e;
    margin: 10% auto;
    padding: 20px;
    border: 2px solid #ffa500;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
    color: #f0f0f0;
}

/* Close button */
.close-button {
    color: #f0f0f0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: #ffa500;
}

/* Modal buttons */
#modalConfirmButton, #modalCancelButton {
    padding: 10px 20px;
    margin: 10px;
    background-color: #444;
    color: #fff;
    border: 2px solid #666;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

#modalConfirmButton:hover, #modalCancelButton:hover {
    background-color: #ffa500;
    color: #1e1e1e;
    border-color: #ffa500;
}

/* Assign Worker Modal Styles */
#assignWorkerModal .modal-content {
    background-color: #1e1e1e;
    margin: 5% auto;
    padding: 20px;
    border: 2px solid #ffa500;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    position: relative;
    color: #f0f0f0;
}

#assignWorkerModal h2 {
    color: #ffa500;
    margin-bottom: 20px;
}

.assign-worker-close {
    color: #f0f0f0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.assign-worker-close:hover {
    color: #ffa500;
}

.worker-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.worker-card {
    position: relative;
    width: 150px;
    height: 230px;
    perspective: 1000px;
    margin: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.worker-card:hover {
    transform: scale(1.05);
}

.worker-card .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    border-radius: 10px;
    overflow: hidden;
}

.worker-card .card-front {
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
}

.worker-card.C .card-front { background-image: url('Images/C.png'); }
.worker-card.R .card-front { background-image: url('Images/R.png'); }
.worker-card.SR .card-front { background-image: url('Images/SR.png'); }
.worker-card.SSR .card-front { background-image: url('Images/SSR.png'); }
.worker-card.UR .card-front { background-image: url('Images/UR.png'); }

.worker-card .card-details {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px;
    box-sizing: border-box;
}

.worker-card .card-details h4 {
    margin: 0;
    font-size: 1em;
}

.worker-card .card-details p {
    margin: 2px 0;
    font-size: 0.9em;
}

.worker-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.7);
}


#assignWorkerCancelButton {
    padding: 10px 20px;
    margin-top: 20px;
    background-color: #444;
    color: #fff;
    border: 2px solid #666;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

#assignWorkerCancelButton:hover {
    background-color: #ffa500;
    color: #1e1e1e;
    border-color: #ffa500;
}

