/**
 * Exchange Rate Ticker - Frontend Styles
 * Version: 2.3.0
 */

/* ========================================
   TICKER BAR
   ======================================== */

#ert-ticker-wrapper {
        position: fixed;
        left: 0;
        right: 0;
        z-index: 99998;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
        font-size: 14px;
        line-height: 1.4;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
        transition: transform 0.3s ease;
}

/* Bottom position (default) */
#ert-ticker-wrapper.ert-ticker-bottom {
        bottom: 0;
}

/* Top position */
#ert-ticker-wrapper.ert-ticker-top {
        top: 0;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Inner container */
.ert-ticker-inner {
        position: relative;
        display: flex;
        align-items: center;
        height: 42px;
        overflow: hidden;
}

/* Scrolling track */
.ert-ticker-track {
        display: flex;
        align-items: center;
        flex: 1;
        overflow: hidden;
}

/* Individual slide (duplicated for seamless loop) */
.ert-ticker-slide {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        white-space: nowrap;
        animation: ert-scroll linear infinite;
}

/* Each rate item */
.ert-rate-item {
        display: inline-flex;
        align-items: baseline;
        padding: 0 14px;
        gap: 4px;
}

.ert-rate-item::after {
        content: "|";
        margin-left: 14px;
        opacity: 0.25;
        font-weight: 300;
}

.ert-rate-item:last-child::after {
        display: none;
}

/* Text styling */
.ert-pair {
        font-weight: 700;
        letter-spacing: 0.3px;
}

.ert-label {
        opacity: 0.65;
        margin-right: 2px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 600;
}

.ert-buying,
.ert-selling {
        font-weight: 600;
        font-variant-numeric: tabular-nums;
}

.ert-sep {
        margin: 0 3px;
        opacity: 0.4;
}

/* Converter button */
.ert-converter-btn {
        position: relative;
        z-index: 3;
        display: flex;
        align-items: center;
        height: 100%;
        flex-shrink: 0;
}

.ert-btn-open-converter {
        display: flex;
        align-items: center;
        height: 100%;
        padding: 0 18px;
        background: rgba(255, 255, 255, 0.12);
        color: inherit;
        text-decoration: none;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.3px;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        transition: background 0.2s ease;
        cursor: pointer;
}

.ert-btn-open-converter:hover {
        background: rgba(255, 255, 255, 0.22);
}

/* ========================================
   CURRENCY CONVERTER MODAL
   ======================================== */

.ert-modal-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.6) !important;
        z-index: 999999 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 16px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        border: none !important;
}

.ert-modal {
        position: relative !important;
        background: #ffffff;
        border-radius: 16px;
        padding: 32px;
        max-width: 420px;
        width: 100%;
        margin: auto !important;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        color: #1a1a2e;
        animation: ert-modal-in 0.25s ease-out;
        float: none !important;
        text-align: left;
}

@keyframes ert-modal-in {
        from {
                opacity: 0;
                transform: translateY(20px) scale(0.95);
        }
        to {
                opacity: 1;
                transform: translateY(0) scale(1);
        }
}

.ert-modal-close {
        position: absolute;
        top: 12px;
        right: 16px;
        background: none;
        border: none;
        font-size: 28px;
        color: #999;
        cursor: pointer;
        line-height: 1;
        padding: 4px;
        transition: color 0.2s;
}

.ert-modal-close:hover {
        color: #333;
}

/* Converter form */
.ert-converter-form {
        display: flex;
        flex-direction: column;
        gap: 16px;
}

.ert-form-row {
        display: flex;
        flex-direction: column;
        gap: 6px;
}

.ert-form-row label {
        font-size: 13px;
        font-weight: 600;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
}

.ert-form-row-flex {
        flex-direction: row;
        align-items: flex-end;
        gap: 10px;
}

.ert-form-group {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 6px;
}

.ert-form-group label {
        font-size: 13px;
        font-weight: 600;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
}

.ert-input,
.ert-select {
        width: 100%;
        padding: 12px 14px;
        border: 2px solid #e5e7eb;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 500;
        color: #1a1a2e;
        background: #fafafa;
        transition: border-color 0.2s, box-shadow 0.2s;
        box-sizing: border-box;
        outline: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
}

.ert-input:focus,
.ert-select:focus {
        border-color: #4f46e5;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ert-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 36px;
        cursor: pointer;
}

/* Convert button */
.ert-convert-btn {
        width: 100%;
        padding: 14px;
        background: linear-gradient(135deg, #1a1a2e, #2d2b55);
        color: #fff;
        border: none;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 700;
        letter-spacing: 0.5px;
        cursor: pointer;
        transition: all 0.2s;
}

.ert-convert-btn:hover {
        background: linear-gradient(135deg, #2d2b55, #3d3b75);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(26, 26, 46, 0.3);
}

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

/* Result area */
.ert-result {
        margin-top: 4px;
        padding: 16px;
        background: #f8f9fa;
        border-radius: 10px;
        border: 1px solid #e5e7eb;
}

.ert-result-amount {
        font-size: 24px;
        font-weight: 700;
        color: #1a1a2e;
        margin-bottom: 4px;
}

.ert-result-rate {
        font-size: 13px;
        color: #888;
        margin-bottom: 10px;
}

.ert-result-details {
        display: flex;
        gap: 16px;
        padding-top: 10px;
        border-top: 1px solid #e5e7eb;
}

.ert-result-buy,
.ert-result-sell {
        font-size: 12px;
        color: #666;
}

.ert-result-buy span,
.ert-result-sell span {
        font-weight: 700;
}

/* Standalone converter (for shortcode) */
.ert-standalone-converter {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 24px;
        background: #fff;
        border-radius: 16px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        color: #1a1a2e;
        box-sizing: border-box;
}

/* ========================================
   SCROLL ANIMATION (set via JS)
   ======================================== */

@keyframes ert-scroll {
        0% {
                transform: translateX(0);
        }
        100% {
                transform: translateX(-50%);
        }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
        #ert-ticker-wrapper {
                font-size: 13px;
        }

        .ert-ticker-inner {
                height: 38px;
        }

        .ert-rate-item {
                padding: 0 10px;
        }

        .ert-converter-btn .ert-btn-open-converter {
                padding: 0 12px;
                font-size: 12px;
        }

        .ert-modal {
                padding: 24px 20px;
                margin: 12px;
        }
}

@media (max-width: 480px) {
        #ert-ticker-wrapper {
                font-size: 12px;
        }

        .ert-rate-item {
                padding: 0 8px;
                gap: 2px;
        }



        .ert-converter-btn .ert-btn-open-converter {
                padding: 0 10px;
                font-size: 11px;
        }
}
