/* Module Management Table Styles */
.module-management-table {
    width: 100%;
    border-collapse: collapse;
    height:100vh;
}
label, legend {
    margin: 0;
}
select {
    margin:0;
    padding: 0.5em 2em;
    margin: 0.5em;
    border-radius: 0.5em;
    width: fit-content;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25em, 1fr));
    gap: 1em;
}

#sortToggleBtn{
    margin:0;
}
.add-scenario-btn{
    padding: 0.5em 1em;
    font-size: 16px;
    font-weight: bold;
    border: none;
    text-align: center;
    text-wrap: nowrap;
    margin: 0;
    display:flex;
}
.module-content-row {
    display: flex;
    flex-direction: column;
    gap: 1em;
    border: 1px solid #ccc;
    padding: 2em;
    border-radius: 1em;
    margin-bottom: 1em;
    background-image: linear-gradient(to right, rgb(255, 255, 255, 1) 60%, rgba(255, 255, 255, 0) 100%), var(--slide-thumb, none);
    background-repeat: no-repeat, no-repeat;
    background-position: left center, right center;
    background-size: 100% 100%, auto 100%;
    color: #222;
    min-height: 25rem;
    place-content: space-between;
    flex-wraP: wrap;
}

.module-content-row td,
.module-content-row th {
    padding:0;
}
.row-btn {
    margin: 1em 0.5em;
    padding: 0;
}

.module-content-tags {
    display: flex;
    align-items: center;
}

.module-content-tag {
    background-color: lightgreen;
    padding: 0.25rem 1rem;
    border-radius: 0.5rem;
    font-size: smaller;
}

.add-scenario-btn:hover {
    transform: translateY(-1px); /* Lift the button slightly */
}


.module-management-table th, .module-management-table td {
    padding: 0.1em;
    text-align: left;
    border-bottom: 1px solid #f4f4f4;
    flex-grow: 1;
}

.scenario-action-buttons{
    margin-bottom: 0;
    vertical-align: -webkit-baseline-middle;
}

/* Header with button (sorting arrows) */
.module-management-table .header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Sort buttons inside module management */
.module-management-table .filter-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    margin-left: 0px;
    transition: color 0.3s ease;
    padding-left: 1em;
}

.module-management-table .filter-btn:hover {
    color: #000;
}

/* Dropdown button for module actions (⋮ button) */
/*.module-management-table .module-actions {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    vertical-align: middle;
    position: relative;
}*/

.module-management-table .modify-module-actions-button:hover {
    color: #000;
}
#moduleContentModal {
    z-index: 3;
}
#upload-progress {
    width: 100%;
    height: 0.25em;                /* taller bar */
    appearance: none;
    -webkit-appearance: none;
    border: none;
    border-radius: 5em;
    overflow: hidden;            /* clip inner corners */
    background: #eef1f5;         /* fallback bg */
}

/* Chrome/Safari */
#upload-progress::-webkit-progress-bar {
    background: #eef1f5;
}
#upload-progress::-webkit-progress-value {
    background: #ff0063;
    transition: width .2s ease;  /* smooth fill */
}
#module-creation-drop-zone {
    border: 1px dashed #bbb;
    padding: 1em;
    text-align: center;
    cursor: pointer;
    border-radius: 1em;
}

/* Dropdown Content for module actions */
.module-management-table .module-dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    font-size: 15px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
}

/* Links inside the module dropdown */
.module-management-table .module-dropdown-content a {
    padding: 12px 16px;
    font-size: 15px;
    display: block;
    text-decoration: none;
    color: black;
}

.module-management-table .module-dropdown-content a:hover {
    background-color: #ddd;
}


.module-management-table .expand-btn:hover {
    color: darkblue;
}

/* Dropdown toggle for both module and scenario dropdowns */
.module-management-table .module-dropdown-content.show {

    display: block;
}

/* Scenarios Table Styles */
.scenarios-table {
    width: 100%;
    border-collapse: collapse;
}

.scenarios-row {
    display:none;
    background-color:white;
}

.scenarios-row.show{
    display:block;
}

.secnarios-row .invite-scenario-btn , .secnarios-row .edit-scenario-btn , .secnarios-row .play-scenario-btn , .secnarios-row .delete-scenario-btn {

    margin-bottom: auto;
}

.row-btns {
    display: flex;
    justify-content: flex-end;
}

.module-details-row {
    display: flex;
    flex-direction: column;
    padding: 0.5em;
    align-items: flex-start;
    border-radius: 1em;
    gap: 1em;
}

.placeholder-module-img {
    width: 100%;
    padding-top: 30%;
    position: relative;
    border-radius: 8px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: pulse 1.5s infinite;
}

/* Set each div within .module-details-row to align with the headers */
.module-details-row > .editable-module-name {
    font-weight:bold;
    font-size:medium;
    color:#000;
    padding: 0 1em;
}


.module-details-row > .editable-module-description {
    font-weight: 400;
    font-size: 1rem;
    flex-grow: 1;
    /* padding: 0 0 0 1em; */
    color: darkgray;
    padding: 0 1em;
}

.editable-module-content-name {
    font-size: larger;
    color: black;
    width: 55%;

}

.editable-module-content-description {
    font-size: medium;
    color: black;
    width: 60%;

}

.module-details-row > .module-date {
    font-weight:bold;
    font-size:medium;
    flex-grow: 1;
    padding: 0 1em;

}

.module-details-row > .module-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    column-gap: 1em;
    flex-grow: 1;
    padding: 0em 1em 1em;

}
.module-btns-bg {
    border: 1px solid black;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    display: flex;
    width: fit-content;
    padding:0.3em;
    pointer-events:none;
}

.other-options {
    position: absolute;
    border: 1px solid #ccc;
    border-radius: 0.5em;
    display: flex;
    flex-direction: column;
    background-color: white;
    padding: 0.5em;
    font-weight: normal;
    z-index: 1;
    width: max-content;
}

.other-options-wrapper {
    position:relative;
}

.other-option {
    align-self: auto;
    display: flex;
    gap: 0.5em;
    padding: 0.5em;
    align-items: center;
    color: #7e7e7e;
}

.other-option.delete-module {
    color: #ff0000;
}

.other-option:hover {
    background-color: #ececec;
    border-radius: 0.25em;
    color: #000;
}


.other-option.delete-module:hover{
    background-color: #ffe5e5;
    color: #ff0000;
}

.module-actions> .expand-btn {
    flex-basis: 15%;
    background: none;
    border: none;
    cursor: pointer;display: flex
;
    flex-direction: column;
    color: blue;
    margin: 0;
    padding:0;
    -webkit-writing-mode: vertical-lr;

}
.compartment {
    padding: 3em;
}
.module-row.expanded {
    box-shadow: 0.2em 0.2em 0.2em 0.2em rgb(0, 0, 0, 0.2);
    border-radius: 1em;
}

.module-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: grid;
    grid-template-rows: auto 1fr;
    border-radius: 1em;
    min-width: 25em;
}

.module-card:hover {

    border: 1px solid #ff0063;
    transition: all .5s ease;

}

.scenarios-table th, .scenarios-table td {
    padding: 0 2em;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.scenarios-table th {
    background-color: #d2d2d2;
    font-weight: bold;
}

.scenarios-table td {
    vertical-align: middle;
}

/* Dropdown button for scenario actions (⋮ button) */
.scenarios-table .modify-scenario-actions-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #555;
    position: relative;
}

.scenarios-table .modify-scenario-actions-button:hover {
    color: #000;
}

/* Dropdown Content for scenario actions */
.scenarios-table .scenario-dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    font-size: 15px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
}
:root {
    --check-col: 18px; /* checkbox size + you control it here */
}

/* Make name | date | checkbox columns */
.document-header,
.document-item {
    display: grid;
    grid-template-columns: 1fr 15em var(--check-col);
    align-items: center;
    column-gap: 1em;
    box-sizing: border-box;
    padding: 1em;
    border-bottom: solid 1px #eee;
    overflow-wrap: anywhere;
}

/* The checkbox column should be exactly the checkbox width */
.toggle-container {
    width: var(--check-col);
    display: flex;           /* center the checkbox */
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

/* Normalize the checkbox itself */
.document-toggle {
    width: var(--check-col);
    height: var(--check-col);
    margin: 0;               /* kill default UA margins */
    vertical-align: middle;  /* avoid baseline quirks */
    /* accent-color: currentColor;  optional: colorize the tick */
}
/* Links inside the scenario dropdown */
.scenarios-table .scenario-dropdown-content a {
    padding: 12px 16px;
    font-size: 15px;
    display: block;
    text-decoration: none;
    color: black;
}

.scenarios-table .scenario-dropdown-content a:hover {
    background-color: #ddd;
}

.scenario-container {
    display: none;             /* Hidden by default */
    width: 100%;               /* Make it take up the full width of the table cell */
    margin-top: 10px;          /* Optional: Add some space above the container */
}

.scenario-container.show {
    display: block;            /* Show the container when toggled */
}

#document-selection-view, #module-info-view{
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


/* Hidden class for scenarios */
.hidden {
    display: none;
}


.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 2em;
    border-radius: 1em;
    width: 70%;
    position:relative;
    height: 70%;
    overflow-y: auto;
    overflow-x: hidden;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.selected-documents-list {
    list-style: none;
    border: 1px solid #eee;
    padding: 0.5em;
    border-radius: 0.5em;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .module-management-table .filter-btn {
        font-size:10px;
    }
    .module-details-row > .editable-module-name,
    .module-details-row > .editable-module-description,
    .module-details-row > .editable-module-date
    {
        font-size:small;
        padding: 0 0 0 0.7em;
    }
    .module-details-row > .module-actions {
        padding: 0 0 0 0.7em;
        column-gap: 0.5em;
        display:block;
    }
    .scenarios-table th, .scenarios-table td {
        padding:0.1em;
    }
    .scenarios-table th {
        font-size: x-small;
    }
    .row-btn {
        margin: 0.5em 0.5em;
        display: flex;
        align-items: anchor-center;
    }

}

.module-thumb {
    width: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

.create-module-dropdown-container .create-module-dropdown-button {
    background: #000000;
    color: white;
    padding: 0.25em 2em;
    border: none;
    border-radius: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid black;
    width: max-content;
    text-transform: capitalize;
    margin:0;
}




