/**
 * Decision Support Tool - Frontend Styles
 */

/* ==========================================================================
   Page 1 - Site Details Form
   ========================================================================== */

.com-dst-tool {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.com-dst-tool h1 {
    color: #1a5a4a;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

/* Introductory text section */
.dst-intro {
    margin-bottom: 2rem;
}

.dst-intro p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.dst-intro ul {
    margin: 0.5rem 0 0.75rem 1.5rem;
    list-style-type: none;
    padding: 0;
}

.dst-intro ul li {
    margin-bottom: 0.25rem;
}

/* Colour key image */
.dst-colour-key {
    float: right;
    margin: 0 0 1rem 1.5rem;
    max-width: 320px;
    border: 1px solid #ddd;
    padding: 10px;
    background: #fff;
}

.dst-colour-key img {
    width: 100%;
    height: auto;
}

/* Form layout - two column: labels left, inputs right */
.dst-form-section {
    margin-bottom: 1.5rem;
    clear: both;
}

.dst-form-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.25rem;
}

.dst-form-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.dst-form-row label {
    flex: 0 0 200px;
    padding-top: 0.5rem;
    font-weight: normal;
}

.dst-form-row label .required {
    color: #333;
}

.dst-form-row .dst-input-wrap {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.dst-input-wrap .dst-spinner {
    display: none;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-top-color: #1a5a4a;
    border-radius: 50%;
    animation: dst-spin 0.8s linear infinite;
}

.dst-input-wrap.dst-loading .dst-spinner {
    display: block;
}

@keyframes dst-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.dst-form-row input[type="text"],
.dst-form-row input[type="email"],
.dst-form-row select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1rem;
}

.dst-form-row input[type="text"]:focus,
.dst-form-row input[type="email"]:focus,
.dst-form-row select:focus {
    outline: none;
    border-color: #1a5a4a;
    box-shadow: 0 0 3px rgba(26, 90, 74, 0.3);
}

/* Radio buttons for Type of record */
.dst-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.4rem;
}

.dst-radio-group label {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0;
    cursor: pointer;
}

.dst-radio-group input[type="radio"] {
    margin: 0;
}

/* Continue button */
.dst-button-row {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.btn-dst-primary {
    background-color: #1a5a4a;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    border-radius: 3px;
    cursor: pointer;
}

.btn-dst-primary:hover {
    background-color: #147a5a;
}

/* Hidden sections */
.dst-hidden {
    display: none;
}

/* Clearfix for floated elements */
.dst-intro::after {
    content: "";
    display: table;
    clear: both;
}

.dst-parameters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.dst-slider {
    width: 100%;
}

.dst-technology-item {
    display: block;
    align-items: center;
    padding: 0;
    cursor: pointer;
}

.dst-technology-name {
    flex: 0 0 250px;
    font-size: 0.9rem;
}

.dst-technology-bar-container {
    flex: 1;
    height: 24px;
    background: #e9ecef;
    border-radius: 4px;
}

.dst-technology-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.dst-technology-bar.suitable {
    background: #28a745;
}

.dst-technology-bar.potentially-suitable {
    background: #ffc107;
}

.dst-technology-bar.poor {
    background: #dc3545;
}

.dst-technology-bar.not-suitable {
    background: #343a40;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .dst-colour-key {
        float: none;
        margin: 0 0 1rem 0;
        max-width: 100%;
    }
    
    .dst-form-row {
        flex-direction: column;
    }
    
    .dst-form-row label {
        flex: none;
        padding-top: 0;
        margin-bottom: 0.25rem;
    }
    
    .dst-form-row .dst-input-wrap {
        max-width: 100%;
    }
}

/* ==========================================================================
   Page 2 - Calculator Interface
   ========================================================================== */

/* .dst-page-2 {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #1a5a4a;
} */

.dst-page-2 > h1 {
    width: 100%;
}

.dst-page2-intro {
    width: 100%;
    margin-bottom: 1rem;
}

/* Nav row - Back button/warning left, module right */
.dst-page2-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dst-nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dst-nav-right {
    /* Module placeholder */
}

@media (min-width: 51rem) {
    .dst-page2-nav {
        flex-direction: column;
        justify-content: space-evenly;
        /*align-items: flex-start;*/
        position: fixed;
        bottom: 0%;
        left: 100%;
        transform: translate(-100%, -0%);
        background: #363636;
        z-index: 100;
        margin:0;
    }
    
    .dst-nav-left {
        flex: 0 0 auto;
    }
    
    .dst-nav-right {
        flex: 0 0 auto;
    }
}

.btn-dst-back {
    background-color: #1a5a4a;
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-dst-back:hover {
    background-color: #147a5a;
}

.dst-nav-warning {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Two-column layout */
.dst-page2-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dst-left-column {
    width: 100%;
}

.dst-right-column {
    width: 100%;
}

@media (min-width: 51rem) {
    .dst-page2-layout {
        flex-direction: row;
    }
    
    .dst-left-column {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .dst-right-column {
        flex: 1;
        min-width: 50%;
    }
}

/* Left Column */
.dst-left-column h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a5a4a;
    margin-bottom: 0.5rem;
}

.dst-dropdowns {
    margin-bottom: 1.5rem;
}

.dst-dropdowns .dst-form-row {
    margin-bottom: 0.5rem;
}

.dst-dropdowns .dst-form-row label {
    font-size: 0.9rem;
}

.dst-dropdowns .dst-input-wrap select {
    padding: 0.4rem;
    font-size: 0.9rem;
}

/* Sliders */
.dst-sliders {
    margin-top: 1rem;
}

.dst-slider-row {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.dst-slider-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.dst-slider-header > input { min-width: fit-content; }
.dst-slider-header > label { min-width: fit-content; }

.dst-slider-header input[type="checkbox"] {
    margin: 0;
}

.dst-slider-header label {
    flex: 1;
    font-weight: normal;
    margin-bottom: 0;
}

.dst-slider-descriptor {
    flex: 1;
    color: #1a5a4a;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
    position: relative;
    left: -11px;
}

.dst-slider-value {
    flex: 1;
    text-align: right;
    color: #666;
}

.dst-slider-not-considered {
    display: none;
    color: #666;
    font-style: italic;
}

.dst-slider-row.dst-slider-disabled .dst-slider-descriptor,
.dst-slider-row.dst-slider-disabled .dst-slider-value,
.dst-slider-row.dst-slider-disabled .dst-slider {
    display: none;
}

.dst-slider-row.dst-slider-disabled .dst-slider-not-considered {
    display: inline;
}

.dst-slider {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: #059ea4;
    border-radius: 4px;
    outline: none;
}

.dst-slider::-webkit-slider-thumb {
    box-shadow: 1px 1px 1px #000000;
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 27px;
    background: #fff;
    border: 1px solid #000000;
    border-radius: 5px;
    cursor: pointer;
}

.dst-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2px solid #1a5a4a;
    border-radius: 50%;
    cursor: pointer;
}

/* Right Column */
.dst-right-column h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a5a4a;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

/* Action Buttons Module Position */
.dst-actions-module {
    /*margin-bottom: 1rem;*/
    padding: 0.5rem;
    /*background: #f8f9fa;*/
    border-radius: 4px;
    min-height: 60px;
}

.dst-actions-placeholder {
    color: #999;
    font-size: 0.85rem;
    text-align: center;
}

/* Hide placeholder if module is loaded */
.dst-actions-module .moduletable + .dst-actions-placeholder {
    display: none;
}

.dst-credits-display {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.dst-credits-count {
    color: #1a5a4a;
    font-weight: 600;
}

/* Filters Section */
.dst-filters-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.dst-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dst-filter-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.dst-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #1a5a4a;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: help;
}

.dst-filter-groups {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dst-filter-groups.dst-visible {
    display: grid;
}

.dst-filter-groups.dst-hidden {
    display: none;
}

@media (max-width: 768px) {
    .dst-filter-groups.dst-visible {
        grid-template-columns: 1fr;
    }
}

.dst-filter-group h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    margin-top: 0rem;
}

.dst-filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
}

/* Methods Section */
.dst-methods-section {
    margin-bottom: 1.5rem;
}

.dst-methods-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.btn-dst-secondary {
    background-color: #1a5a4a;
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-dst-secondary:hover {
    background-color: #147a5a;
}

/* Technology List */
.dst-technology-list {
    /* No max-height - display all technologies */
}

.dst-technology-header {
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    font-family: 'comfortaa', "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
    padding-top: 1rem;
}

.dst-technology-header:hover {
    background: #f8f9fa;
}

.dst-technology-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dst-technology-name {
    font-size: 0.95rem;
    color: #1a5a4a;
    font-weight: 500;
}

.dst-technology-bar-row {
    display: flex;
    align-items: center;
}

.dst-technology-bar-wrapper {
    flex: 1;
    padding-right: 0.5rem;
}

.dst-technology-bar-container {
    height: 20px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.dst-technology-bar {
    height: 100%;
    transition: width 0.3s ease;
    min-width: 2px;
}

.dst-technology-bar.green {
    background: #59CB31;
}

.dst-technology-bar.amber {
    background: #FF9F00;
}

.dst-technology-bar.red {
    background: #FF0000;
}

.dst-technology-bar.grey {
    background: #6c757d;
}

.dst-technology-expand {
    flex: 0 0 30px;
    text-align: center;
    font-size: 1.2rem;
    color: #1a5a4a;
    line-height: 20px;
}

/* Child technology indentation */
.dst-technology-item.child-technology {
    padding-left: 0;
}

.dst-technology-child-indicator {
    color: #999;
    margin-right: 0.25rem;
    font-family: monospace;
}

.dst-technology-child-spacer {
    display: inline-block;
    width: 1rem;
}

/* Filtered out technologies */
.dst-technology-item.filtered-out {
    opacity: 0.5;
}

.dst-technology-item.filtered-out .dst-technology-name {
    color: #999;
}

.dst-technology-item.filtered-out .dst-technology-bar-container {
    background: #ddd;
}

.dst-technology-item.filtered-out .dst-technology-bar {
    background: #999;
}

/* Technology item structure for accordion */
.dst-technology-header:hover {
    background: #f8f9fa;
}

.dst-technology-alert {
    color: #FF9F00;
    margin-left: 0.25rem;
    font-size: 1rem;
}

.dst-technology-alert svg {
    position: relative;
    top: 2px;
    width: 1em;
    height: 1em;
}

.dst-technology-accordion {
    padding: 0 1rem 1rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.dst-technology-generic {
    margin-bottom: 1rem;
}

.dst-technology-generic h3,
.dst-technology-generic h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #1a5a4a;
}

.dst-technology-generic ul {
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.dst-technology-custom {
    margin-bottom: 1rem;
    font-style: italic;
    color: #555;
}

.dst-technology-comments {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.dst-technology-comments:empty {
    display: none;
}

/* Details button */
.btn-dst-details {
    background-color: #1a5a4a;
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-dst-details:hover:not(:disabled) {
    background-color: #147a5a;
}

.btn-dst-details:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #6c757d;
}

/* Technology Tags */
.dst-technology-tags {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.dst-tag {
    display: inline-block;
    padding: 0.15em 0.4em;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border-radius: 3px;
    white-space: nowrap;
	position: relative;
    bottom: 3px;
}

.dst-tag-image {
    height: 1.2em;
    width: auto;
    vertical-align: top;
}

.dst-tag-link {
    text-decoration: none;
}

.dst-tag-link:hover {
    opacity: 0.8;
}

/* Save Modal Dialog */
.dst-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.dst-modal-overlay.dst-hidden {
    display: none;
}

.dst-modal-dialog {
    background-color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 5px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dst-modal-dialog h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: #333;
}

.dst-modal-dialog p {
    margin: 0 0 1.5rem 0;
    color: #555;
}

.dst-modal-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dst-modal-buttons button {
    min-width: fit-content;
    padding: 0.6rem 1.25rem;
}
