body, html {
    display: flex;
    flex-direction: column;
    font-family: 'Open Sans', sans-serif;
    background-color: #f4f4f4;
    height: 100vh;
    margin: 0;
    width: 100%;
}

*, *:before, *:after {
    box-sizing: border-box;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #fff;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex: 1;
    overflow: auto;
}

header {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: space-between;
    margin-top: 5px;
}

.header-field {
    padding: 10px;
    margin-right: 50px;
    flex: 1;
    text-align: left;
}

.header-field.special {
    flex: 2;
    display: flex;
    align-items: center;
}

.header-field img {
    width: 70%;
    height: auto;
}

.link {
    font-family: 'Franklin Gothic Demi', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    text-decoration: none;
    color: lightgray;
}

.link:hover {
    color: darkgray;
}

.chart-container {
    flex: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    max-width: 70%;
    height: 95%;
    padding: 0 1px;
    position: relative;
}

.chart-container #no-data-message {
    position: absolute;
    text-align: center;
    font-size: 1.2rem;
    color: #666;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
    margin-right: 2px;
}

.options-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 30%;
    border: thick double #ececec;
    border-radius: 5px;
    overflow: hidden;
}

.field-5 {
    padding: 5px;
    margin: 6px;
    text-align: center;
}

.options-title {
    margin-bottom: 6px;
    font-style: italic;
    color: #D5D2D2;
    font-size: 12px;
}

.category-buttons, .futures-container, .chartchange {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: 3px;
}

.category-buttons button, .chartchange button, .futures-container button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    background-color: #ececec;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.category-buttons button:hover, .chartchange button:hover, .futures-container button:hover {
    background-color: darkgray;
}

.futures-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.radio-group {
    display: flex;
    justify-content: center;
    gap: 5px;
    width: 100%;
    flex-wrap: wrap;
}

.radio-group label {
    font-size: 14px;
    white-space: nowrap;
}

footer {
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 12px 0;
    margin-top: 6px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.footer-content div:first-child {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.footer-logo {
    margin-left: auto;
}

.footer-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-size: 16px;
    transition: color 0.3s ease;
}

.footer-logo a:hover {
    color: #1e90ff;
}

.footer-logo img {
    width: 28px;
    height: 28px;
}

button:hover {
    color: black;
}

.chart-buttons-container {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 0px;
    padding: 0;
    position: relative;
}

.chart-buttons-container button {
    padding: 5px 20px;
    margin-left: 10px;
    font-size: 14px;
    cursor: pointer;
    background-color: #f8f8f8;
    border: 1px solid #333;
    border-radius: 5px;
    color: #333;
}

.chart-buttons-container button:hover {
    background-color: #e0e0e0;
}

#download-chart {
    padding: 5px 20px;
    font-size: 14px;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid transparent;
    color: #333;
    outline: none;
    position: absolute;
    right: 40px;
}

#download-chart:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

#myChart {
    background-color: white;
    cursor: none;
    padding-right: 5px;
}

#myChart:hover {
    cursor: crosshair;
}

#chart-buttons-container {
    display: none;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex: 1;
}

.auth-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: lightgray;
    cursor: pointer;
}

.auth-btn:hover {
    color: black;
}

.register-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 1rem;
    margin-bottom: 5px;
}

.form-group input {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.auth-btn {
    padding: 10px;
    font-size: 1.2rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.auth-btn:hover {
    background-color: lightgray;
}

.centered {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 20px;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.nav-btn {
    padding: 5px 10px;
    font-size: 1rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.nav-btn:hover {
    background-color: lightgray;
}

.left-btn {
    margin-right: auto;
}

.right-btn {
    margin-left: auto;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    box-sizing: border-box;
    overflow: hidden;
}

.modal-content {
    width: 100vw;
    height: 100vh;
    max-width: 1800px;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    position: relative;
    margin: 5vh auto;
    box-sizing: border-box;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#fullscreenChart {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background-color: white;
    cursor: crosshair;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    color: black;
    cursor: pointer;
}

p {
    font-size: 13px;
    line-height: 1.5;
}

summary::-webkit-details-marker{display:none;}
summary::-moz-list-bullet{list-style-type:none;}
summary::marker{display:none;} 

summary {
    font-size: 16px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

summary:before {
    content: "ᐳ";
    font-size: 8px;
    color: black;
    display: inline-block;
    transition: transform 0.3s ease-in-out;
}
details[open] > summary:before {
  transform: rotateZ(90deg);
}
summary ~ * {
   padding:0 1em 0 1em;
}
details[open] summary ~ *{ 
  animation: sweep .5s ease-in-out;
}
@keyframes sweep {
  0%    {opacity: 0;}
  100%  {opacity: 1;}
}
summary:focus {
  outline:0;
  box-shadow: inset 0 0 1px rgba(0,0,0,0.3), inset 0 0 2px rgba(0,0,0,0.3);
}

details {
    width: 100%;
    margin-bottom: 0px;
    padding: 2px;
}

details summary {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

details p {
    text-align: left;
}

details a.link {
    font-size: 18px;
    font-weight: bold;
    color: black !important;
    text-decoration: none;
}

details a.link:hover {
    text-decoration: underline;
}

details img {
    display: block;
    margin: 10px auto;
    max-width: 100%;
    height: auto;
}

h1 {
    font-size: 35px;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 15px;
}

p :first-child {
    margin-bottom: 10px;
    font-size: 14px;
}

.faq-container {
    width: 100%;
    text-align: center;
    padding-bottom: 20px;
}

.faq-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    padding-top: 0px;
}

.faq-content details {
    width: 100%;
}

.faq-content details[open] p {
    display: block;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: black;
    color: white;
    text-align: center;
    border-radius: 5px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.password-container {
    position: relative;
    width: 100%;
}

.password-container input[type="password"],
.password-container input[type="text"] {
    width: 100%;
    padding-right: 40px;
    box-sizing: border-box;
}

.password-container .toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
    color: inherit;
}

#field-5-3,
#field-5-4 {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#field-5-3.show,
#field-5-4.show {
    visibility: visible;
    opacity: 1;
    max-height: 500px;
}

.radio-group input {
    position: relative;
    z-index: 10;
}

.chartchange button {
    position: relative;
    z-index: 10;
}

.radio-group, .chartchange {
    pointer-events: auto;
}

#field-5-3, #field-5-4 {
    position: relative;
    z-index: 5;
}

.header-field.link {
    white-space: nowrap;
}

.header-field.link a {
    font-weight: 600;
    font-size: 28px;
    color: #cdc4c4;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.2s ease-in-out;
}

.header-field.link a:hover {
    color: #444;
    text-decoration: none;
}

div.centered a.link{
    font-size: 14px;
}

#mini-chart-container {
    margin-top: 5px;
    text-align: center;
}

#miniChart {
    width: 100%;
    height: 15px;
}

#mini-chart-title {
    font-family: 'Open Sans', sans-serif;
    padding-top: 10px;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
}

@media (max-width: 768px) {
    .chart-container {
        margin: 6px;
        padding: 0px;
        width: calc(100% - 12px);
        max-width: 100%;
        height: auto;
        min-height: 400px;
        max-height: 800px;
    }

    .chart-container canvas {
        width: 100% !important;
        height: 100% !important;
        max-height: 95vh !important;
    }

    .chartchange {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
        overflow-y: auto;
        max-height: 180px;
        padding: 0px;
        margin: 0px;
    }

    body, html {
        padding: 0;
        margin: 0 auto;
        width: 100%;
        height: auto;
        overflow: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-content {
        flex-direction: column;
        align-items: center;
        padding: 2px;
    }

    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-field {
        margin-right: 0px;
        padding: 0px;
        flex: none;
        width: auto;
        text-align: center;
    }

    .options-container {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .options-container button {
        width: 90%;
        margin: 5px 0;
        font-size: 14px;
    }

    .field-5 {
        padding: 6px;
        margin: 6px 0;
    }

    .header-field.special {
        margin-top: 10px;
        flex: 1;
    }

    .header-field.special img {
        width: 100%;
        max-width: 400px;
        height: auto;
    }

    .header-field img {
        width: 100%;
        height: auto;
    }

    .header-field.link {
        font-weight: 600;
        font-size: 20px;
        color: #cdc4c4;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: color 0.2s ease-in-out;
        flex-grow: 0;
    }

    .header-field.auth-buttons {
        flex: 1 100%;
        display: flex;
        justify-content: center;
        gap: 15px;
    }
    
    .auth-buttons {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        width: 100%;
        margin-top: 10px;
        margin-bottom: 10px;
        flex-wrap: wrap;
    }

    .auth-btn {
        margin-left: 12px;
        text-align: center;
        padding: 10px 15px;
        font-size: 1rem;
        min-width: 120px;
    }

    .chart-buttons-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        padding: 10px;
        text-align: center;
        margin: 0px;
    }

    .chart-buttons-container button {
        padding-right: 10px;
        padding-left: 10px;
        margin-bottom: 2px;
        margin-left: 2px;
        flex: 0 1 auto;
        min-width: 100px;
        max-width: 110px;
        height: 30px;
        font-size: 12px;
        text-align: center;
        background-color: #ececec;
        border: 1px solid #333;
        border-radius: 5px;
        transition: background-color 0.2s ease;
        white-space: nowrap;
    }

    .chart-buttons-container button:hover {
        background-color: darkgray;
    }

    footer {
        margin-top: 0px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .footer-content div:first-child {
        position: static;
        transform: none;
    }

    .footer-logo {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .modal {
        display: none;
        position: fixed;
        padding: 0;
        overflow: hidden;
    }

    .modal-content {
        width: 100vw;
        height: 95vh;
        max-width: 100vw;
        max-height: 95vh;
        margin: 0;
        border-radius: 0;
        padding: 0; /* Убираем отступы */
    }

    #fullscreenChart {
        width: 99%;
        height: 99%;
        max-width: 99%;
        max-height: 99%;
    }

    #download-chart {
        right: 1px;
        top: 40px;
        font-size: 12px;
    }

    .futures-container {
        grid-template-columns: repeat(3, 1fr);
        margin: 0px;
        padding: 0px;
    }

    .category-buttons{
        margin: 0px;
    }

    h1 {
        font-size: 20px;
        text-align: center;
        margin-top: 0px;
        margin-bottom: 5px;
    }

    p {
        font-size: 14px;
        text-align: justify;
    }

    details {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    summary {
        font-size: 16px;
        padding: 10px;
    }

    img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    .faq-content {
        padding-top: 20px;
        padding-bottom: 30px;
    }

    #miniChart {
        width: 100%;
        max-width: 100%;
        height: 40px;
    }
}

@media (min-width: 1024px) {
    .container {
        margin: 10px auto 0;
        padding: 0 10px;
        max-width: calc(100% - 20px);
    }
}

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.cookie-consent p {
    margin: 0;
    flex: 1;
    color: #333;
    padding-right: 10px;
}

.cookie-link {
    color: #000;
    text-decoration: underline;
}

.cookie-link:hover {
    text-decoration: none;
}

.cookie-btn {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.cookie-btn:hover {
    background-color: #555;
}

@media (max-width: 768px) {
    .cookie-consent {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
    }

    .cookie-consent p {
        margin-bottom: 15px;
        padding-right: 0;
    }

    .cookie-btn {
        width: 100%;
        max-width: 250px;
        padding: 12px;
    }
}