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

/* Apply Poppins font globally to all elements */
* {
    font-family: 'Poppins', sans-serif;
}


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;
}

/* NEW CODE SLDIER */
.side-panel {
    overflow-y: auto; /* Enable scrolling */
    max-height: 100vh; /* Limit to viewport height */
    padding-bottom: 20px; /* Space for bottom content */
}

.player-names-container {
    margin: 15px 20px;
}

.player-name {
    color: white !important;
    font-weight: bold !important;
    font-family: 'Poppins', sans-serif !important;
    text-align: center;
    background-color: transparent;
    border: none;
    outline: none;
}

.player img {
    border-radius: 0; /* Ensure images are not rounded */
    width: 50px; /* Set appropriate width */
    height: 50px; /* Set appropriate height */
    object-fit: contain; /* Ensure the image retains its aspect ratio */
}




#playerNamesTextArea {
    width: calc(120% - 40px); /* Adjusted for containment */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    resize: none;
    box-sizing: border-box;
}

#addPlayerNamesBtn {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

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


/* END NEW CODE SLIDER */

#pitchGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    grid-template-rows: repeat(3, auto);   /* 3 rows */
    gap: 8px; /* Add spacing between images as desired */
}


/* 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 CUSTOM TSHIRT STYLER */
/* T-shirt body with subtle rounded shoulders */
.CustomTshirt {
  position: absolute;
  top: 5%;
  left: 25%;
  width: 50%;
  height: 90%;
  background: none;
  z-index: 1;
  border-radius: 5% 5% 5% 5%; /* Soft rounding on the top corners for shoulders */
}

/* Inner T-shirt layer with matching shape */
.CustomTshirt-copy {
  width: 100%;
  height: 100%;
  position: absolute;
  background: #f0f0f0;
  z-index: 2;
  border-radius: 5% 5% 5% 5%; /* Matches the outer T-shirt layer */
}

/* Sleeves with gentle rounding and inward positioning */
.TshirtSleeves {
  position: absolute;
  height: 35%;
  width: 42%; /* Slightly narrower width for a more fitted look */
  background: #f0f0f0;
  z-index: 1;
  border-radius: 10% 10% 0 0; /* Smooth rounding at the top edge */
}

/* Left sleeve positioned closer and higher */
.TshirtSleeve-left {
  left: -8%;   /* Bring inward towards T-shirt body */
  top: -65%;    /* Move up closer to shoulder area */
}

/* Right sleeve positioned closer and higher */
.TshirtSleeve-right {
  right: -8%;  /* Bring inward towards T-shirt body */
  top: -65%;    /* Move up closer to shoulder area */
}


.color-palette {
  text-align: center;
  margin-top: 20px;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 10px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid #ccc;
}

.color-swatch:hover {
  border: 2px solid #333;
}



.box {
  position: relative;
  margin: auto;
  display: block;
  margin-top: 2%;
  margin-bottom: 10%;
  width: 500px;
  height: 500px;
  background: none;
}

.CustomTshirt {
  position: absolute;
  top: 5%;
  left: 25%;
  width: 50%;
  height: 90%;
  background: #f0f0f0; /* Slightly darker white */
}

.CustomTshirt-copy {
  width: 100%;
  height: 100%;
  position: absolute;
  background: #f0f0f0;
  z-index: 2;
}

.TshirtHem {
  position: absolute;
  height: 2%;
  width: 100%;
  left: 0%;
  bottom: 0%;
  border-top: 2px dashed grey;
}

.TshirtSleeves {
  position: absolute;
  height: 35%;
  width: 45%;
  background: #f0f0f0;
  z-index: 1;
}

.TshirtSleeve-left {
  left: 0%;
  top: 0%;
  transform-origin: top left;
  transform: rotate(50deg);
}

.TshirtSleeve-right {
  right: 0%;
  top: 0%;
  transform-origin: top right;
  transform: rotate(-50deg);
}

.TshirtSleeve-hem {
  position: absolute;
  height: 5%;
  width: 100%;
  left: 0%;
  bottom: 0%;
  border-top: 2px dashed grey;
}

.TshirtCollar {
  position: absolute;
  height: 10%;
  width: 50%;
  left: 25%;
  top: 0%;
  border: 2px dashed grey;
  border-top: none;
  border-radius: 0px 0px 93% 100%/0px 0px 96% 100%;
}

.TshirtCollar-hem {
  position: absolute;
  height: 85%;
  width: 90%;
  left: 5%;
  top: 0%;
  border: solid grey;
  border-width: 0px 2px 2px 2px;
  border-radius: 0px 0px 93% 100%/0px 0px 96% 100%;
  background: #424242;
}

@media all and (max-width: 500px) {
  .box {
    margin-top: 50px;
    width: 350px;
    height: 350px;
  }

  .sleeve-hem {
    border-top: 1px dashed grey;
  }

  .hem {
    border-top: 1px dashed grey;
  }

  .collar {
    border: 1px dashed grey;
    border-top: none;
  }

  .collar-hem {
    border-width: 0px 1px 1px 1px;
  }
}


/* MAIN CUSTOM TSHIRT STYLER END */

/* Main T-shirt styling */



/* Player name positioning */
.player-name {
  position: absolute;
  top: 75px; /* Adjust to position name just below T-shirt */
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: center;
}



/* 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 */
/* Sidebar (Side Panel) */
.side-panel {
    width: 0;
    max-width: 400px; /* Increase max width */
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #333;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.3s ease;
    padding-top: 20px;
    z-index: 1400;
    color: white;
}

/* Opened state for the side panel */
.side-panel.active {
    width: 400px; /* Set fixed width to 400px */
}



/* Divider for each section */
.divider {
    height: 1px;
    background-color: #555;
    margin: 10px 20px;
}

/* Color Picker Row (Side-by-Side) */
.color-picker-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Configuration Container */
.configuration-container {
    padding: 15px 20px;
}

/* Size Slider */
#sizeSlider {
    width: 100%;
    margin-top: 5px;
}

/* Switch Styling */
.switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

/* Toggle Switch for Facing Selection */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #28a745;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Dropdown Styling */
select#styleSelect {
    width: 100%;
    margin-top: 5px;
    padding: 10px;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #333;
    color: white;
    border: 1px solid #ccc;
    appearance: none;
}


/* 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(3, 1fr); /* 3 columns */
  gap: 4px;
}

.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;
}




.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: 305px; /* 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: 20px; /* Adjusted gap to match the spacing */
    padding: 0 15px; /* Add padding for equal spacing */
}

/* 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;
}

/* Limit Header Field Width for Location and Coach */
@media (max-width: 600px) {
    .info-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .labels-container {
        display: flex;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .location-text,
    .coach-text {
        display: inline-block;
        max-width: 10ch; /* Limit visible text to 10 characters */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* Show "..." for overflow */
    }

    /* Ensure download button is centered below labels */
    .button-container {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-top: 10px;
    }
}

/* Mobile Footer Adjustments */
@media (max-width: 600px) {
    .controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }

    /* Consistent layout for each section */
    .add-players-control,
    .coach-control,
    .location-control {
        display: flex;
        justify-content: center;
        width: 90%; /* Consistent width for all sections */
        margin-bottom: 10px;
    }

    /* Specific width for input fields */
    .location-control input {
        width: 60%; /* Fit within mobile screen */
    }

    .add-players-control input[type="number"] {
        width: 35%; /* Reduced for compact alignment */
    }

    .coach-control input {
        width: 100%; /* Full width for Coach field */
        max-width: 100%; /* Prevent overflow */
    }
}

