@font-face {
    font-family: "SF Pro Rounded";
    src: url("src/SF-Pro-Rounded-Regular.otf") format("opentype");
    font-weight: normal;
}

* {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: "SF Pro Rounded", sans-serif;
    background-color: #D6D2CF;
    margin: 0;
    padding: 20px;
    user-select: none;
    direction: ltr;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 30px;
    font-weight: bold;
    margin: 0;
}

#datetime {
    font-size: 14px;
    color: #666;
    margin: 0;
    padding: 5px 10px;
    border-radius: 5px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--grid-size, 155px), 1fr));
    gap: 10px;
}

.card {
    background: #F8F7F5;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 120px;
    aspect-ratio: auto;
}

.currency-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flag {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.name-and-code {
    text-align: right;
}

.name {
    font-weight: bold;
    font-size: 16px;
    margin: 0;
}

.code {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.price {
    font-size: 35px;
    font-weight: bold;
    margin: 0;
}

.change {
    font-size: 18px;
    color: red;
    margin: 0;
}

.change.positive {
    color: #2ecc71;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    width: 270px;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 10px; /* بردم سمت راست */
    font-size: 18px;
    cursor: pointer;
}

.currency-item {
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.currency-item input {
    margin-left: 8px;
    cursor: pointer;
}

.modal-content h2 {
    margin-top: 0;
    font-size: 18px;
    color: #333;
}

.currency-item label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

#settings-btn {
    font-size: 15px;
    cursor: pointer;
    margin-left: 10px;
}

.settings-section {
    margin: 12px 0;
    padding: 12px;
    border-radius: 10px;
    background: #f5f5f5;
    border: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-section label {
    font-size: 14px;
}

/* دکمه Manage Cards */
.card-btn {
    font-size: 14px;
    font-weight: bold;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: #fff;   
    color: #000;        
    cursor: pointer;
    border: 1px solid #ccc;
}

/* ورودی Grid Size */
.grid-Input {
    width: 60px;
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #ccc;
    text-align: center;
    font-size: 13px;
}

.grid-Input:focus {
    border: 1px solid #4facfe;
}

/* حالت دارک مود */
body.dark-mode {
    background-color: #1e1e1e;
    color: #f0f0f0;
}

body.dark-mode .settings-section,
body.dark-mode .currency-item,
body.dark-mode .modal-content,
body.dark-mode .currency-item label,
body.dark-mode .modal-content h2 {
    background-color: #2c2c2c;
    color: #f0f0f0;
}

body.dark-mode .card {
    background: #2b2b2b;
    color: #fff;
}

body.dark-mode .card-btn {
    background: #1e1e1e; 
    color: #fff;
    border: 1px solid #666;
}

body.dark-mode .grid-Input {
    background: #1e1e1e;
    color: #fff;        
    border: 1px solid #555;
}