/* Container */
.forex-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* وسط‌چین عمودی کل container */
    width: 100%;
}

/* Timezone filter */
.fxgadgets-timezone-filter {
    display: flex;
    justify-content: center; /* وسط‌چین افقی */
    flex-wrap: wrap;         /* در موبایل زیر هم قرار گیرد */
    gap: 20px;
    margin-bottom: 15px;
    direction: ltr;          /* اجباری LTR برای متن انگلیسی */
}

.timezone-wrapper {
    display: flex;
    align-items: center;     /* وسط‌چین عمودی label و select */
}

.timezone-wrapper label {
    margin-right: 5px;
    white-space: nowrap;
    text-align: left;
    direction: ltr;
}

.timezone-wrapper label::after {
    content: ":";
    margin-left: 0;
    margin-right: 3px;
}

.timezone-wrapper select {
    text-align: center;      /* وسط‌چین متن داخل select */
    min-width: 150px;        /* عرض مناسب */
}

/* Time and Sessions */
#forex-time-label {
    text-align: center;
    margin: 10px 0;
    font-weight: bold;
    font-size: 18px;
}

#forex-sessions {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 150px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    margin-bottom: 5px;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    background: #fff;
    color: #000;
}

#forex-hours {
    position: relative;
    width: 100%;
    height: 20px;
    margin-top: 5px;
}

.hour-label {
    position: absolute;
    font-size: 10px;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #000 !important; /* !important اگر توسط JS یا سایر CSS override شود */
}

.session-block {
    opacity: 0.4;
    transition: opacity 0.3s ease;
    user-select: none;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
    height: 20px;
}

.session-active {
    opacity: 1 !important;
}

.marker-time {
    position: absolute;
    top: -25px;
    font-size: 12px;
    font-weight: bold;
    transform: translateX(-50%);
    white-space: nowrap;
}

.marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: red;
    cursor: grab;
}

.marker:active {
    cursor: grabbing;
}

.marker-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 40px;
}

.marker-handle div {
    pointer-events: none;
}

.marker-handle .arrow-up {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid red;
}

.marker-handle .arrow-down {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid red;
}

.marker-handle .line-center {
    width: 4px;
    flex-grow: 1;
    background: red;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    #forex-sessions {
        background: #1a202c;
        color: #fff;
        border-color: #444;
    }

    .hour-label { color: #e5e7eb; }
    .session-block { color: #fff; }
}

/* Responsive */
@media (max-width: 600px) {
    #forex-time-label { font-size: 16px; }
    .hour-label { font-size: 9px; }
    .session-block { font-size: 12px; line-height: 18px; height: 18px; }
    .marker-time { font-size: 10px; }
    .marker-handle { height: 30px; }
    .fxgadgets-timezone-filter { gap: 10px; }
}
