@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    font-family: 'Poppins', sans-serif;
    background-color: #f4f4f9;
}

/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #282c34;
    color: white;
    padding: 10px 20px;
}

/* SLIDER STYLER */
input[type="range"] {
    -webkit-appearance: none; /* Override default styling */
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #28a745;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #28a745;
    border-radius: 50%;
    cursor: pointer;
}
/* MAIN SLIDER STYLER */

/* SLIDER DROPDOWN STYLE */

select {
    appearance: none; /* Removes default dropdown arrow */
    background-color: #f4f4f9;
    border: 1px solid #ccc;
    padding: 10px;
    font-size: 1rem;
    border-radius: 5px;
    color: #333;
    width: 100%;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="gray" d="M2 0L0 2h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

select:focus {
    outline: none;
    border-color: #28a745;
}

/* FINISH DROP DOWN STYLER */

.player-shirt {
    display: block;
    border: 1px solid transparent; /* Optional: Helps in debugging visibility */
}

/* Base style for side panel */
.side-panel {
    width: 0; /* Start closed */
    overflow-x: hidden;
    transition: width 0.3s ease;
}

/* Opened state for the side panel */
.side-panel.active {
    width: 250px; /* Adjust as needed */
}

/* Ensure label and color picker are stacked vertically */
.color-picker-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align boxes directly under labels */
  margin-bottom: 15px; /* Space between sections */
}

.color-preview {
  width: 30px;
  height: 30px;
  background-color: #fff;
  border: 1px solid #ccc;
  cursor: pointer;
}

.color-picker-popup {
  display: none;
  position: absolute;
  top: 35px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr); /* 10 columns to match each row in the image */
  gap: 4px; /* Adjust spacing between buttons as needed */
}
.color-option {
  width: 20px; /* Size of each color square */
  height: 20px;
  border: none;
  cursor: pointer;
}


.color-option {
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: transform 0.1s;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: #333;
}

.show-colors-btn {
  margin-top: 10px;
  background: none;
  border: none;
  color: #333;
  font-size: 0.9em;
  cursor: pointer;
}

/* this code new */
.color-picker-container {
  position: relative;
  display: inline-block;
  margin-bottom: 10px; /* Space between color pickers */
}

.color-preview {
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  cursor: pointer;
  display: inline-block;
}

#mainColorPicker .color-preview {
    background-color: #add8e6; /* Light blue for main color */
}

#sleeveColorPicker .color-preview {
    background-color: #dda0dd; /* Light purple for sleeve color */
}

.color-picker-popup {
  display: none;
  position: absolute;
  top: 40px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* Adjusted for better spacing */
  gap: 4px;
}

.color-option {
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: transform 0.1s;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: #333;
}

/* COLOR PICKER CODE ENDS HERE */



/* Example pattern class for SVG shirts */
.pattern-horizontal2 .main {
  fill: url(#horizontalStripesPattern);
}
.pattern-diagonal .main {
  fill: url(#diagonalStripesPattern);
}

.upload-logo-container input[type="file"] {
    display: none;
}

.upload-logo-container label {
    display: inline-block;
    padding: 10px 20px;
    background-color: #28a745;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

.upload-logo-container label:hover {
    background-color: #218838;
}



.shirt-main {
  width: 80%; /* Adjust as needed */
  height: 100%;
}

.shirt-sleeve {
  width: 20%; /* Adjust to reflect the sleeve area */
  height: 100%;
}


.football-pitch {
    width: 100%;
    height: calc(100vh - 140px);
    background-image: url("../img/pitch.png");
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    position: relative;
    margin-top: 60px;
    z-index: 1;
}

/* Styling for the dynamically generated T-shirt image */
.generated-shirt {
    position: absolute;
    top: 50%;  /* Adjust as needed to align vertically on pitch */
    left: 50%; /* Adjust as needed to align horizontally on pitch */
    transform: translate(-50%, -50%); /* Centers the image on the pitch */
    width: 15%; /* Sets a reasonable size for the T-shirt image, adjust as needed */
    max-width: 120px; /* Ensures it doesn’t become too large */
    height: auto; /* Maintains aspect ratio */
    z-index: 2; /* Places the T-shirt above the pitch */
    pointer-events: none; /* Prevents accidental interactions */
}

/* Club Logo */
.club-logo-container {
    display: flex;
    align-items: center;
}

.round-club-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Hamburger Menu Positioned Below Header */
.hamburger-menu {
    position: absolute;
    top: 60px; /* Position just below the header */
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: white;
    z-index: 1500;
}

/* Sidebar */
.side-panel {
    width: 0; /* Start hidden */
    max-width: 250px; /* Limit the max width when open */
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #333;
    overflow-x: hidden;
    overflow-y: auto; /* Scroll for content if needed */
    transition: width 0.3s ease; /* Smooth slide-in effect */
    padding-top: 20px;
    z-index: 1400;
    color: white;
}




/* TEST SECTION START */

/* Default T-Shirt Color for Players */
.player-shirt {
    background-color: white; /* Default color */
    width: 60px;  /* Adjust width as needed */
    height: 60px; /* Adjust height as needed */
    border-radius: 50%; /* Makes it circular */
    border: 2px solid black; /* Optional: outline for visibility */
}

/* Player-specific styling */
.player {
    position: absolute;
    cursor: pointer;
    text-align: center;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

/*TEST SECTION */


.side-panel .close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    cursor: pointer;
    color: white;
}

/* Section Title */
.section-title {
    font-size: 1.2rem;
    margin-left: 20px;
    color: skyblue;
    font-family: 'Poppins', sans-serif;
}

/* Pitch and Kit Selection */
.pitch-selection, .kit-selection {
    padding: 10px 20px;
}

.pitch-selection img {
    width: 50px;
    height: 50px;
    margin: 5px;
    cursor: pointer;
}

input[type="color"], select {
    width: 100%;
    margin-top: 5px;
    cursor: pointer;
    border-radius: 5px;
}

/* Info Container */
.info-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.labels-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.labels-container label {
    font-weight: bold;
    color: skyblue;
    font-size: 1rem;
    margin-right: 5px;
    white-space: nowrap;
}

.location-text, .coach-text {
    font-size: 1rem;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Slightly Adjusted Download Button Position */
.button-container {
    display: flex;
    align-items: center;
    margin-right: 20px; /* Moves download button slightly to the left */
}

button {
    padding: 5px 10px;
    background-color: #28a745;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #218838;
}

/* Football Pitch Styling */
.football-pitch {
    width: 100%;
    height: calc(100vh - 140px);
    background-image: url("../img/pitch.png");
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    position: relative;
    margin-top: 60px; /* Adjusted to clear header */
    z-index: 1;
}

/* Footer Controls */
.controls {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 8px;
    background-color: #282c34;
    color: white;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* Footer Controls Layout - Aligning Fields and Buttons */
.row-controls {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 10px;
    max-width: 100%;
}

/* Smaller input fields and aligned labels/buttons */
.control-group {
    display: flex;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    color: white;
}

.control-group label {
    font-weight: bold;
    color: skyblue;
    font-size: 0.9rem;
    margin-right: 5px;
}

.control-group input, .control-group select {
    padding: 5px;
    font-size: 0.9rem;
    border-radius: 5px;
    border: none;
    outline: none;
    width: 120px; /* Smaller width for compact look */
    font-family: 'Poppins', sans-serif;
    background-color: #3b3f45;
    color: white;
}

.control-group button {
    padding: 5px 10px;
    background-color: #28a745;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Hover Effect for Buttons */
.control-group button:hover {
    background-color: #218838;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .row-controls {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
    }

    .control-group {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .location-text, .coach-text {
        max-width: 100px;
        font-size: 0.9rem;
    }

    .button-container {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 10px;
    }
}
