/* hierarchy.css */

/* General Styles */

ul, li {
    list-style-type: none; /* Removes the list marker from all <ul> and <li> elements */
}

:root {
    --main-bg-dark:  #39449A;
    --main-bg-light: #ecd18d;
    --stepFields: #FAF1DD;
    --blue-light: #e7ecff;
    --fold1: rgb(245, 145, 30);
    --thelet: #98D4F8;
    --redG: #E0242D;
    --fold2: #bee7ff;
    --place-red: #fc410e;
    --foldOrange: #EE7C00;
    --formwdth: 40vw
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #7e7d86;
}

h2 {
    font-size: 110%;
    color: #202020;
}

/* Modal Container */
.animation-config-modal-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* width: 100%; */
    /* max-width: 1350px; */
    /* max-height: 95%; */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 98657;
}


/* Steps Container */
.animation-config-steps-container {
    flex: 1;
    /* overflow-y: auto; */
}

/* Step and Sub-step Elements */
.step, .substep {
    margin: 3px;
    padding: 3px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: grab;
}

.substep {
    padding: 0px 10px;
    padding-bottom: 5px;
}

/* Step Header and Sub-step Content */
.step-header, .substep-content {
    display: flex;
    align-items: center;
    gap: 1%;
    padding-right: 10px;
}

/* Buttons */
.buttons, .substep-buttons-container {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.animation-config-button, .clone-step, .delete-step, .fold-substep, .fold-step, 
.change-position, .clone-substep, .select-me, .delete-substep, .add-subSteps, .select-me, .fold-all-substeps{
    /* margin: 2px; 
    padding: 4px 10px; */
    margin-right: 5px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    background-color: rgb(255, 255, 255);
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); 
}

/* Hover Effect */
.animation-config-button:hover, .clone-step:hover, .delete-step:hover, .fold-substep:hover, 
.fold-step:hover, .change-position:hover, .clone-substep:hover, .select-me:hover, .delete-substep:hover , .fold-all-substeps:hover{
    transform: scale(1.02); /* Slightly increase size */
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); /* Add shadow */
    filter: brightness(1.1); /* Slightly brighten color */
}

/* Click (Active) Effect */
.animation-config-button:active, .clone-step:active, .delete-step:active, .fold-substep:active, 
.fold-step:active, .change-position:active, .clone-substep:active, .select-me:active, .delete-substep:active, .fold-all-substeps:active {
    transform: scale(0.98); /* Slightly shrink for a "press" effect */
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2); /* Reduce shadow */
    filter: brightness(0.98); /* Darken slightly */
}

.play-step-localPlay {
    /* margin-left: 13px;
    margin-right: 3px; */
    /* background-color: #dff60e; */
}


.play-step-localPlay:hover {
    transform: scale(1.05);
    background-color: #bee7ff;
}

.play-step-localPlay:active {
    background-color: #e2ff28;
}

.select-me {
    background-color: rgb(253, 253, 253);
    /* border-radius: 30px; */
    padding: 2px;
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5); 
   
}

.animation-config-button.add-step {
    background-color: #28a745;
}

.animation-config-button.add-sub-step {
    background-color: #007bff;
}

.animation-config-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Drag-and-Drop Enhancements */
.step[draggable="true"], .substep[draggable="true"] {
    cursor: move;
    width: 700px;
}

.drag-over {
    border: 2px dashed #007bff;
    background-color: #e9f5ff;
}

/* Placeholders */
.placeholder, .step-placeholder, .substep-placeholder {
    height: 10px;
    background-color: var(--place-red);
}

.substep-placeholderCLR {
    background-color: #f805e4;
}

.show-placeholder {
    transform: scale(1); /* Scale up when shown */
}

/* Clone Highlight */
.clone-highlight, .cloned-highlight {
    background-color: lightblue;
    border: 2px solid orange;
    animation: fadeBorder 1s forwards;
}

@keyframes fadeBorder {
    0% { border-color: orange; }
    100% { border-color: transparent; }
}

/* Input Fields and Labels */
.animation-config-label-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
}

.animation-config-label-container label {
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 2px;
}

.animation-config-input {
    padding: 5px;
    /* border: 1px solid #ccc; */
    border-radius: 3px;
    font-size: 12px;
    width: 80px;


    /* here */
}


.stepFields {
 
gap: calc(var(--formwdth) * (0.03));
 
}

.subStepHeaderType {
    width: 300px;
}

input[type="text"].stepName {
    width: 350px;
}

.xCor, .yCor, .zCor {
    background-color: #bee7ff;
    border: 2px solid rgb(143, 1, 1);
    
}

/* Sub-step Icon Styles */
.substep-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
}

.substep-icon {
    display: inline-flex;
    align-items: center;

}

/* Focus and Custom Input Styles */
input:focus, textarea:focus {
    outline: none;
    border: 2px solid black;
}

input[type="text"]:focus {
    border-color: rgb(0, 2, 71);
    background-color: #d6f7a1;
}


/* Step Container */



.substep {
    background-color: var(--main-bg-light);
}

.step-index {
    padding: 4px;
    font-size: 100%;
    color: rgb(245, 245, 245);
    background-color: var(--main-bg-dark);
    margin: 5px;
    border-radius: 3px;
}

.substep-content {
    align-items: center;
    /* margin-bottom: 6px; */
}

.stepType, .animation-config-input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    
}

.stepType {
     width: 120px;
}

.stepFields {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    /* gap: 10px; */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 10px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: auto;
    max-height: 40vh;
    /* height: 300px; */
}

.substep-name-field, .stepType {
    background-color: var(--fold2);
}

.substep-name {
    width: calc(var(--formwdth)*(0.30));
}

.substep-type-field {
    width: calc(var(--formwdth)*(0.05));

}



/* Dynamic Height Handling for StepFields and Substeps (GSAP controlled) */
.stepFields-container, .substeps {
    display: block;
    /* max-height: 0; */
    height: 0px;  /* Let GSAP control the height */
    overflow-y: hidden;
    
}


.stepFields-container {
    background-color: var(--stepFields);  /* Light beige background */
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;  
    border: #3fb703 3px; 
    border: 2px solid rgb(62, 69, 126)
}

#timelineOutput {
    width: 100%;
}

#type-selector {
    position: absolute;
    top: 66px;
    background-color: rgb(78, 76, 76);
    display: flex;
    gap: 1px;
    flex-wrap: wrap;
    display: none;
    left: 2px;
    z-index: 1000;
    padding: 0px;
    border: 1px solid #ccc;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    padding-left: 5px;
}

.type-select-button {
    background: #ffffff;

    border: none;
    padding: 1px 2px;
    cursor: pointer;
    transition: background 0.3s;
}

.type-select-button:hover {
    background: #f7efb6;
}

.active-type {
    background: #007BFF;
    color: white;
    font-weight: bold;
}

#type-selector-container {
    background: #007BFF; /* Blue background */
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.type-button {
    background: white;
    border: none;
    padding: 2px 2px;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
    font-weight: bold;
}

.type-button:hover {
    background: #e0e0e0;
}


#type-selector-button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 1px 1px;
    cursor: pointer;
    border-radius: 5px;
}

/* #type-selector-popup {
    position: absolute;
    
    background: white;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
} */
/* 
.type-option button {
    width: 100%;
    padding: 1px;
    background: #f1f1f1;
    border: none;
    cursor: pointer;
    text-align: left;
}

.type-option button:hover {
    background: #ddd;
} */

#selectionsDiv {
    position: absolute;
    top: 50vh;
    left: 40.5vw;
    /* transform: translateX(-50%); */
    background: white;
    /* padding: 20px; */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    z-index: 1000;
    width: 10vw;
}

#dragArea4 {
    background-color: #EBEAE8;
    /* height: 100px; */
}

.top-container {
    background: #f4f4f4;
    padding: 10px;
    text-align: center;
    border-bottom: 2px solid #ddd;
}

.stepFields-container.expanded, .substeps.expanded {
    height: auto !important; /* Let the container expand naturally */
    /* overflow-y: auto;  Enable scrolling if needed */
  
}

.custom-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
}

.custom-checkbox input {
    display: none; /* Hide the default checkbox */
}

.checkmark {
    width: 24px; /* Increased for better visibility */
    height: 24px;
    border: 2px solid #4e4e4e;
    border-radius: 6px; /* Rounded corners */
    display: flex;
    justify-content: center;
    align-items: center;
    /* background-color: rgba(24, 196, 64, 0.5); */
    background-color: transparent;
    transition: background-color 0.1s ease-in-out;
}

.custom-checkbox input:checked + .checkmark {
    background-color: #18c440; /* Green when checked */
    /* border-color:; */
    border: 2px solid  #0a0a0a;
}

.custom-checkbox input:checked + .checkmark::after {
    content: '✔';
    font-size: 18px; /* Slightly bigger for visibility */
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Perfect centering */
    font-weight: bold;
}

/* Default Placeholder Styling */
/* Default Placeholder Styling */
.substep-placeholderINSRT {
    height: 10px;
    background-color: rgba(0, 255, 0, 0.2); /* Light green background */
    border: 2px solid green; /* Default green border */
    border-radius: 8px; /* Rounded corners */
    margin: 4px 0; /* Some spacing between placeholders */
    transition: all 0.2s ease-in-out; /* Smooth transition */
    cursor: pointer;
}

/* Highlighted Placeholder (Selected) */
.substep-placeholderINSRT.selected-placeholderINSRT {
    border: 3px solid black !important; /* Strong black border when selected */
    background-color: rgba(0, 0, 0, 0.1); /* Subtle darkening */
    height: 20px;
}

.button-asm-editor-container {
    display: flex;
    justify-content: center; /* Centers items horizontally */
    align-items: center; /* Aligns items vertically */
    gap: 10px; /* Adds spacing between buttons */
    flex-wrap: wrap; /* Ensures buttons wrap if there are too many */
    height: auto;
    padding: 0px 0; /* Adds padding to prevent it from collapsing */
}


.floating-card2 {
    position: absolute;
    top: 1px;
    right: 1px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    z-index: 999999999;
    width: 500px;
    /* text-align: center; */
    font-size: 16px;
    border: 2px solid  rgba(255, 255, 255, 0.15);;
    max-height: 90vh;
}

/* .floating-card2 button {
    background-color: red;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 10px;
}

.floating-card2 button:hover {
    background-color: darkred;
} */



/* Optional: Blinking cursor effect */
/* @keyframes blink {
    50% {
        opacity: 0;
    }
}

#assemblyEventsJSON::after {
    content: "█"; 
    animation: blink 1s infinite;
} */




#textdiv1 {
    background-color:#007bff;
    position: absolute;
    z-index: 999999;
    bottom: 50px;
    right: 80px;
}

.clear-json-button-div {
    position: absolute;
    bottom: calc(50% - 20px);
    left: -40px;
   
}



.clear-json-button {
    background: red;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
}

.upload-json-button-div {
    position: absolute;
    bottom: calc(50% - 60px);
    left: -40px;
   
}

.upload-json-button {
    background: blue;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
}



/* .animation-config-steps-container, 
.substeps, 
.stepFields-container {
    height: auto !important;
    overflow-y: hidden !important;
} */

.step-container {
    
    
   
    
    
   

    margin: 0px;
    padding: 1px;
    border-radius: 10px;
    border: 1px solid #040508;
    background-color: var(--main-bg-dark);
    /* width: var(--formwdth); */
    margin-top: 3px;
    max-height: 800px;
    overflow-y: auto; /* Enables vertical scrolling */
    overflow-x: hidden; /* Hides horizontal scrolling */
    height: auto; /* Default height adapts to content */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: rgb(12, 171, 70) black;
    user-select: text;
    
}

.substeps {
    max-height: 600px;
    overflow-y: auto; /* Enables vertical scrolling */
    overflow-x: hidden; /* Hides horizontal scrolling */
    height: auto; /* Default height adapts to content */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: rgb(26, 20, 202) black;
    user-select: text;

}

/* Hide default checkbox */
.custom-text input[type="checkbox"] {
    display: none;
  }
  
  /* Create box */
  .custom-text .checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid #ccc;
    position: relative;
    vertical-align: middle;
    transition: background-color 0.2s ease;
  }
  
  /* Show blue background when checked */
  .custom-text input[type="checkbox"]:checked + .checkmark {
    background-color: #2196F3;
  }
  
  /* Add ✔ checkmark using pseudo-element */
  .custom-text input[type="checkbox"]:checked + .checkmark::after {
    content: '✔';
    color: white;
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  #stepsContainer {
    overflow-y: auto;              /* Enables vertical scrolling */
    overflow-x: hidden;            /* Hides horizontal scrolling */
    height: auto;                  /* Default height adapts to content */
    max-height: 1077px;             /* Limit max height */
    scrollbar-width: thin;         /* For Firefox */
    scrollbar-color: rgb(26, 20, 202) black;
    user-select: text;
    margin-top: 2px;
}


/* Remove or override these conflicting styles */
.substeps, .stepFields-container {
    height: 0px;
   
}

/* Remove this later override completely (or conditionally toggle it) */
/* .substeps.expanded {
    height: auto !important;
    overflow: visible;
} */
