/* Base font family for all elements */
body {
    font-family: 'Vazirmatn', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f9f9f9;
    direction: rtl;
}

/* Container styling */
.container {
    position: relative; /* Ensures stacking context for dropdowns */
    overflow: visible; /* Allows dropdowns to overflow beyond the container */
    z-index: 1; /* Default stacking context for all elements */
    margin-top: -100px !important;
    
}
.container {
    max-width: 500px;
    margin: 10px auto;
    padding: 30px; /* Increased padding */
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    text-align: center;
}


/* Currency input boxes */
.currency-box {
    position: relative; /* Ensures stacking of dropdowns within boxes */
    z-index: 2; /* Higher than the container */
}
.currency-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    position: relative;
}

.currency-box input {

    flex: 1;
    border: none;
    outline: none;
    text-align: left;
    font-size: 1.2rem;
    direction: ltr;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600; /* SemiBold for numbers */
    
}

.currency-box span.label {
    position: absolute;
    top: -25px !important;  /* Moves the label higher */
    right: -5px !important;
    background: #ffffff00 !important;
    padding: 0 5px;
    font-size: 0.75rem !important;
    color: #555;
}




/* Custom dropdowns */
.custom-dropdown {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 120px;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    cursor: pointer;
    background: transparent;
    width: 100%;
    user-select: none;
}

.dropdown-selected img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 5px;
}

.dropdown-selected svg {
    width: 12px;
    height: 12px;
    margin-left: 5px;
    fill: #000;
}

/* Dropdown list styling */
.dropdown-list {
    position: absolute;
    top: 100%; /* Ensures the dropdown opens just below the box */
    right: 0;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    z-index: 999; /* Highest z-index to prevent being hidden */
    display: none;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dropdown-list.open {
    display: block;
    opacity: 1;
    transform: scaleY(1);
}

.dropdown-list .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    user-select: none;
    font-family: 'Vazirmatn', sans-serif;
}

.dropdown-list .dropdown-item:hover {
    background: #f0f0f0;
}

.dropdown-list .dropdown-item img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 5px;
}

/* Labels */
.currency-box span.label {
    position: absolute;
    top: -10px;
    right: 10px;
    background: #fff;
    padding: 0 5px;
    font-size: 0.9rem;
    color: #555;
}

/* Divider */
.currency-box .divider {
    height: 30px;
    width: 1px;
    background: #ddd;
    margin-right: 10px;
    align-self: center;
}

/* Swap icon */
.exchange-icon {
    margin: 34px auto;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background-color: #f1f1f1; /* Default background color */
    border-radius: 50%; /* Make it circular */
    transition: background-color 0.3s ease; /* Smooth transition */
    user-select: none; /* Prevent selection */
}

.exchange-icon:hover {
    background-color: #e0e0e0; /* Slightly darker background on hover */
}

.exchange-icon img {
    width: 40px;
    height: 40px;
    pointer-events: none; /* Prevent interaction with the image */
    user-select: none; /* Prevent selection of the image */
}


/* Rate info styling */
.rate-info {
    font-size: 0.9rem;
    color: #666;
    font-family: 'Vazirmatn', sans-serif;
}

p.center-text.error-message {
    margin: 0;
    padding: 0;
}
.rate-info.error-message {
    margin: 0;
    padding: 0px 0; /* Adjust as needed */
}


p {
    text-align: center;
  }

  .center-text {
    text-align: center;
  }
  

.error-message {
    color: red;
    text-align: center;
  }

  .error-input {
    background-color: #ffe6e6; /* Light reddish background */
    transition: background-color 0.2s ease;
  }
  
  .error-box {
    background-color: #ffe6e6; /* Light reddish background */
    transition: background-color 0.2s ease;
  }
  
  
  
.unit-price-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Optionally, add padding or margin as needed */
  }
  
  .unit-price-label {
    /* In an RTL page, text is right-aligned by default */
    text-align: right;
  }
  
  .price-left {
    /* Force left alignment for the price portion */
    text-align: left;
    direction: ltr;  /* Ensure that numbers and any Latin text are rendered left-to-right */
  }
  

.price-left {
    display: inline-block;
    text-align: left;
    direction: ltr; /* This ensures that numbers and Latin text are left-to-right */
    margin-left: 5px; /* Optional: adjust spacing as needed */
  }
  

.rate-info-container {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.rate-info-container .rate-info:first-child {
    text-align: left;
}

.rate-info-container .rate-info:last-child {
    text-align: right;
}

/* Quick buy button */
.quick-buy {
    display: block;
    width: 100%;
    padding: 15px;
    background: #fcb900;
    color: #000000;
    font-size: 1.1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: 'Vazirmatn', sans-serif;
    margin-top: 20px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.quick-buy-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    width: 24px;
    height: 24px;
}





.quick-buy:hover {
    background: #e5a800;
}


/* Error overlay to cover the page */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);  /* Semi-transparent background */
    z-index: 9999;
}

/* Keyframes for fadeInScale remain the same */
@keyframes fadeInScale {
    0% {
      opacity: 0;
      transform: scale(0.8);
    }
    50% {
      opacity: 0.7;
      transform: scale(1.1);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
}
  
.error-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    width: 350px;  /* Fixed width */
    height: 100px; /* Fixed height */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInScale 0.3s ease-out;
}

.error-text {
    color: red;
    font-size: 0.8rem;
    margin: 12px 0 25px 0;
    font-family: 'Vazirmatn', sans-serif;
}

.error-ok-button {
    background-color: green;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 160px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
}

.error-ok-button:hover {
    background-color: darkgreen; 
}

.lottie-header {
    max-width: 560px;         /* Constrain header to main container width */
    margin: 0 auto 20px auto;  /* Center the header on the page */
    display: flex;
    justify-content: flex-end; /* Push animation to the right */
    align-items: center;       /* Vertically center the animation */
    height: 200px;             /* Adjust height as desired */
    overflow: hidden;
    background-color: transparent; /* Fallback background */

    /* Background image settings */
    background-image: url('images/Header.png');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: contain;      /* Or 'cover' if you prefer */
    background-color: transparent; /* Fallback background */
    background-size: auto 58%;
  }
  
  #lottie-container {
    margin-left: -60px;
    width: 50%;    /* Adjust this percentage to control the animation size */
    height: 100%;
  }

  
  .footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;               /* Same width as your main container */
    width: 100%;                    /* Ensures the footer uses all available space up to max-width */
    background-color: #8aa8f5;         /* Dark background */
    color: #fff;                    /* White text for contrast */
    padding: 20px;
    border-radius: 10px 10px 0 0;    /* Rounded top corners only */
    text-align: center;
    z-index: 1000; 
    font-size: 0.7rem;                 /* Ensures it stays above other content */
  }
  
  body {
    position: relative;
    background-color: #e2e9f328; /* Main background color */
  }
  
  body::before {
    content: "";
    position: fixed;  /* or absolute if desired */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use the SVG as a mask */
    -webkit-mask-image: url('https://telegram.org/img/tgme/pattern.svg?1');
    mask-image: url('https://telegram.org/img/tgme/pattern.svg?1');
    mask-repeat: repeat;
    mask-size: 20%; /* Adjust the size of each pattern tile */
    /* Set the desired color and opacity */
    background-color: rgba(0, 17, 255, 0.082); /* Example: semi-transparent red */
    z-index: -1; /* Ensure it appears behind all content */
  }
  
/* Price Banner Section */
/* Price Banner Section */
/* Price Banner Section */


/* Price Banner Section */
/* Price Banner Section */
.price-banner {
    display: flex;
    flex-wrap:wrap;
    justify-content: flex-end; /* Align items from the right */
    gap: 17px;
    /*width:321px; /* Ensures two boxes fit per row */
    margin:auto; /* Center the entire section */
    max-width: 445px;
    margin: 10px auto;
    padding: 30px; /* Increased padding */
    margin-bottom: 70px;
}

/* Media query for screens less than 500px wide */
@media (max-width: 500px) {
    .price-banner {
        display: flex;
        flex-wrap:wrap;
        justify-content: flex-end;
        max-width: 293px;
    }

}

/* Each Price Box */
.price-box {
    background: #222;
    color: white;
    padding: 15px;
    border-radius: 25px;
    max-width: 140px;
    width: 100px; /* Remove the spacing offset */
    text-align: center;
    font-family: 'Vazirmatn', sans-serif;
    margin-left: 7px;

    
}






/* Adjust the currency header inside each box */
.price-header {
    display: flex;
    align-items: left;
    justify-content: space-between; /* Ensures flag is on the left and text is on the right */
    width: 100%;
    padding: 5px 10px; /* Adds some spacing */
}

/* Adjust the flag */
/* New Container for Flag & Currency Name */
.price-title {
    display: flex;
    justify-content: center;
    align-items: center;
    justify-content: space-between; /* Pushes flag & text to opposite sides */
    width: 100%;
    margin-bottom: 10px;
    height: 25px;
}

/* Flag Styling */
.price-flag {
    padding-left: 0px;
    width: 30px;
    height: 30px;
    border-radius: 15px;
}

/* Currency Name & Code */
.price-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align text to the right */
    font-size: 0.7rem;
    margin-right: 5px;
    font-weight: bold;
}




/* Prices Container */
.price-values {
    display: flex;
    flex-direction: column;
    gap: 5px;
    
}

/* Buy & Sell Prices */
.price-sell, .price-buy {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-left: 0px;
    margin-right: -3px;
    background: #222;
    border-radius: 15px;
    max-height: 13px;
}
.custom-span {
    font-size: 2rem;
    color: blue;
  }

.currency-name
{
    font-size: 1rem;
    color: rgb(255, 255, 255);
}
.currency-code
{
    font-size: 0.8rem;
    color: rgb(136, 136, 136);
}

.buy-price
{  
    
    font-size: 1.4rem;
    color: rgb(255, 255, 255);
    margin-top: -2px;
}
.sell-price
{  
    
    font-size: 1.4rem;
    color: rgb(255, 255, 255);
    margin-top: -2px;
}
.buy-text
{  
    
    font-size: 0.85rem;
    color: rgb(117, 117, 117);
    margin-top: 5px;
}
.sell-text
{  
    
    font-size: 0.85rem;
    color: rgb(117, 117, 117);
    margin-top: 2px;
}

.price-values.single {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50px; /* adjust this value as needed */
}

/* Style placeholder text with low opacity */
input::placeholder {
    opacity: 0.5;
    color: #888;
}
/* Increase font size for inputs showing the shared custom placeholder text */
input.custom-placeholder {
    font-size: 0.8rem; /* Adjust as needed */
}
/* Style the placeholder text for inputs that use custom text */
input.custom-placeholder-text::placeholder {
    font-size: 0.8rem; /* Adjust this value as needed */
}
