/*
Copyright © ICTU
Licensed under the EUPL
*/
* {
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family:
        RO Sans,
        Calibri,
        Arial,
        Verdana,
        sans-serif;
    color: #333;
}

.main-container {
    display: flex;
    min-height: calc(100vh - 20px);
    padding: 20px;
    border-radius: 20px;
    align-items: normal;
}

.sidebar {
    width: 25%;
    background: #154274;
    color: white;
    padding: 30px;
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 30px;
    text-align: center;
    background: #fff;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.contract-item {
    padding: 15px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.contract-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
    border-left-color: #0c6b9f;
}

.contract-item.active {
    background: rgba(52, 152, 219, 0.3);
    border-left-color: #0c6b9f;
    overflow: hidden;
}

.main-content {
    flex: 1;
    padding: 30px;
    background: #f3f3f3;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 25px;
    min-height: calc(100vh - 200px);
}

.chart-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    align-items: center;
}

.chart-container-wide {
    grid-column: span 2;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    align-items: center;
}

.chart-container-error {
    grid-column: span 2;
    background: #ff646e;
    border: 3px red solid;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    height: fit-content;
}

.error-message {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.chart-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.chart-wrapper {
    flex: 1;
    position: relative;
}

.no-selection {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 15px;
}

.no-selection-content {
    text-align: center;
    color: #6c757d;
}

.no-selection-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    border: none;
    background: #0c6b9f;
    color: white;

    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
    min-width: 150px;
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.3);
    min-width: 150px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.4);
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
}

.add-pair-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.3);
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.add-pair-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: center;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    color: #333;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #0c6b9f;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    background: #fdfdfd;
}

.form-input:hover {
    border-color: #bdc3c7;
}

.form-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.form-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    align-items: center;
    gap: 5px;
}

.form-label.key-label::before {
    font-size: 16px;
}

.form-label.value-label::before {
    font-size: 16px;
}

@media screen and (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .chart-container-wide {
        grid-column: span 1;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
}

.details-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.details-container > div:last-child {
    margin-top: auto;
}

.details-contract {
    align-items: start;
}

.tree {
    --spacing: 1.5rem;
    --radius: 10px;
}

.tree li {
    display: block;
    position: relative;
    padding-left: calc(2 * var(--spacing) - var(--radius) - 2px);
    align-items: start;
}

.tree ul {
    margin-left: calc(var(--radius) - var(--spacing));
    padding-left: 0;
}

.tree ul li {
    border-left: 2px solid #e7ebf8;
    margin: 10px 0;
}

.tree ul li:last-child {
    border-color: transparent;
}

.tree ul li::before {
    content: "";
    display: block;
    position: absolute;
    top: calc(var(--spacing) / -2);
    left: -2px;
    width: calc(var(--spacing) + 2px);
    height: calc(var(--spacing) + 1px);
    border: solid #e7ebf8;
    border-width: 0 0 2px 2px;
}

.tree summary {
    display: block;
    cursor: pointer;
}

.tree summary::marker,
.tree summary::-webkit-details-marker {
    display: none;
}

.tree summary:focus {
    outline: none;
}

.tree summary:focus-visible {
    outline: 1px dotted #333;
}

.tree li::after,
.tree summary::before {
    content: "";
    display: block;
    position: absolute;
    top: calc(var(--spacing) / 2 - var(--radius));
    left: calc(var(--spacing) - var(--radius) - 1px);
    width: calc(2 * var(--radius));
    height: calc(2 * var(--radius));
    border-radius: 50%;
    background: #e7ebf8;
}

.tree summary::before {
    z-index: 1;
    background: #0c6b9f url("../../assets/expand-collapse.svg") 0 0;
}

.tree details[open] > summary::before {
    background-position: calc(-2 * var(--radius)) 0;
}
