@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-Thin.ttf") format("truetype");
  font-weight: 100;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-UltraLight.ttf") format("truetype");
  font-weight: 200;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-Light.ttf") format("truetype");
  font-weight: 300;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-Regular.ttf") format("truetype");
  font-weight: 400;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-Medium.ttf") format("truetype");
  font-weight: 500;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-DemiBold.ttf") format("truetype");
  font-weight: 600;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-Bold.ttf") format("truetype");
  font-weight: 700;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-ExtraBold.ttf") format("truetype");
  font-weight: 800;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-Black.ttf") format("truetype");
  font-weight: 900;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-ExtraBlack.ttf") format("truetype");
  font-weight: 950;
}

@font-face {
  font-family: "IRANSansX";
  src: url("/assets/font/IRANSansX-Heavy.ttf") format("truetype");
  font-weight: 1000;
}

:root {
  --bg-color: #f4f4f4;
  --bg2-color: #ffffff;
  --bg-trnsprnt: rgba(255, 255, 255, 0.5);
  --border-color: #ffffff;
  --active: rgba(0, 0, 0, 0.04);
  --green: #0a9200;
  --red: #c41010;
}

:root[data-theme="dark"] {
  --bg-color: #151515;
  --bg2-color: #252525;
  --bg-trnsprnt: rgba(80, 80, 80, 0.3);
  --border-color: #252525;
  --active: rgba(0, 0, 0, 0.2);
  --green: #0a9200;
  --red: #c41010;
}

::-webkit-scrollbar {
  display: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "IRANSansX";
  user-select: none;
  -moz-user-select: none;
  -webkit-user-drag: none;
}

html,
body {
  scroll-behavior: smooth;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  padding: 30px 20px 100px 20px;
  background: var(--bg-color);
  transition: 0.3s;
}

header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
}

header h1 {
  font-size: 34px;
  font-weight: 300;
}

#date {
  font-size: 18px;
  font-weight: 300;
  opacity: 0.5;
}

.currency-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.currency-card {
  background: var(--bg2-color);
  border-radius: 40px;
  corner-shape: squircle;
  padding: 1rem;
  flex: 0 0 calc(50% - 5px);
  text-align: center;
  transition:
    flex-basis 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s ease,
    opacity 0.25s ease;
  position: relative;
  overflow: hidden;
}

.accent-blob {
  position: absolute;
  z-index: 0;
  top: -50px;
  left: -50px;
  width: 170px;
  height: 170px;
  background: radial-gradient(
    circle at center,
    var(--accent) 0%,
    transparent 80%
  );
  opacity: 0;
}

[data-theme="dark"] .accent-blob {
  opacity: 0.07;
}

.currency-container.tiles-view .currency-card {
  flex: 0 0 calc(50% - 5px);
}

.currency-container.list-view .currency-card {
  flex: 0 0 100%;
}

.currency-container.list-view .currency-card .currency-change {
  position: absolute;
  text-align: end;
  bottom: 18px;
  left: 18px;
}

.currency-container.list-view .currency-card .currency-price {
  margin-top: 30px;
}

.currency-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: row-reverse;
  position: relative;
  z-index: 1;
}

.currency-header img {
  width: 35px;
  height: 35px;
}

.currency-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.currency-name {
  font-size: 1rem;
  font-weight: 800;
}

.currency-en {
  opacity: 0.5;
  font-size: 0.8rem;
}

.currency-change {
  width: 100%;
  margin-top: 30px;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: start;
}

.change-positive {
  color: var(--green);
}

.change-negative {
  color: var(--red);
}

.change-neutral {
  opacity: 0.5;
}

.currency-price {
  width: 100%;
  margin-top: 5px;
  font-size: 1.3rem;
  font-weight: 500;
  text-align: start;
}

.currency-price span {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.5;
}

#floating-footer {
  position: fixed;
  bottom: 30px;
  width: calc(100% - 42px);
  background: var(--bg-trnsprnt);
  backdrop-filter: blur(10px);
  border-radius: 60px;
  corner-shape: squircle;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.footer-icon {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-icon img {
  opacity: 0.8;
}

#add-item-btn {
  background: var(--active);
  corner-shape: squircle;
  border-radius: 40px;
  padding: 10px;
}

#settings-btn {
  background: var(--active);
  corner-shape: squircle;
  border-radius: 40px;
  padding: 10px;
}

#add-popup {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 65%;
  height: 50%;
  background: var(--bg-trnsprnt);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  border-radius: 40px;
  corner-shape: squircle;
  backdrop-filter: blur(25px);
  z-index: 2000;

  opacity: 0;
  transform: translateY(40px) scale(0.5);
  transform-origin: bottom right;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
  pointer-events: none;
}

#add-popup.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

#popup-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#popup-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #444;
}

#popup-body {
  flex: 1;
  overflow-y: auto;
  border-radius: 40px;
  corner-shape: squircle;
}

.currency-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  margin-bottom: 2px;
  transition: background 0.2s ease;
}

.currency-option.active {
  background: var(--active);
}

.currency-option:last-child {
  margin-bottom: 0;
}

.currency-option .label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.currency-option img {
  width: 32px;
  height: 32px;
}

.currency-option span {
  font-size: 0.95rem;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease-in-out;
  z-index: 1500;
}

#overlay.active {
  opacity: 1;
  pointer-events: all;
}

#settings-popup {
  position: fixed;
  bottom: 90px;
  left: 20px;
  width: 60%;
  background: var(--bg-trnsprnt);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  border-radius: 40px;
  corner-shape: squircle;
  backdrop-filter: blur(15px);
  z-index: 2000;

  opacity: 0;
  transform: translateY(40px) scale(0.5);
  transform-origin: bottom left;

  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;

  pointer-events: none;
}

#settings-popup.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.setting-option {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s ease;
}

[data-theme="dark"] body {
  background: var(--bg-color);
  color: white;
}

[data-theme="dark"] .footer-icon img {
  filter: invert(1);
}
