/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-green: #001338;
    --dark-green: #000a1f;
    --light-green: #002a5c;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

body {
    font-family: 'IRANSansX', 'Tahoma', 'Arial', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--white);
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    direction: rtl;
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* اجازه انتخاب متن در input ها */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

/* صفحه لاگین */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-green);
    margin-bottom: 20px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 14px;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
}

/* استایل برای input های صفحه لاگین که کلاس ندارند */
.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="email"],
.login-card input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s;
    background: var(--white);
    -webkit-appearance: none;
    direction: rtl;
    text-align: right;
}

.login-card input[type="text"]::placeholder,
.login-card input[type="password"]::placeholder,
.login-card input[type="email"]::placeholder {
    color: #999;
    opacity: 0.7;
    font-weight: 400;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus,
.login-card input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.1);
    background: #fafafa;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s;
    background: var(--white);
    -webkit-appearance: none;
    direction: rtl;
    text-align: right;
}

.form-control::placeholder {
    color: #999;
    opacity: 0.7;
    font-weight: 400;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.1);
    background: #fafafa;
}

.form-control:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

input[type="number"].form-control {
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    direction: ltr;
    text-align: left;
}

input[type="text"].form-control,
select.form-control {
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
}

.btn-primary:active {
    transform: scale(0.98);
    background: var(--dark-green);
}

/* Header */
.app-header {
    background: var(--primary-green);
    color: var(--white);
    padding: 12px 16px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 60px;
}

.header-left {
    flex: 1;
}

.logo-text {
    font-size: 14px;
    font-weight: 600;
    color: #ffd700;
    font-style: italic;
}

.header-center {
    flex: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.app-logo {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    margin-bottom: 4px;
    filter: brightness(0) invert(1);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.user-name {
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0.9;
    margin-top: 28px;
  margin-right: 7rem;
}

.wifi-icon {
    font-size: 14px;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* System Status Indicator */
.system-status-indicator {
    position: absolute;
    top: 8px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.status-text {
    color: var(--white);
    font-size: 11px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.icon-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

/* محتوای صفحات */
.app-content {
    padding-bottom: 80px;
    min-height: calc(100vh - 60px - 80px);
    background: #f5f5f5;
}

.content-page {
    display: none;
    padding: 0;
    background: #f5f5f5;
    min-height: calc(100vh - 60px - 80px);
}

.content-page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Action Bar */
.action-bar {
    background: var(--primary-green);
    color: var(--white);
    padding: 16px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    border-radius: 0;
}

.check-icon {
    font-size: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 600;
}

.tab-btn.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 12px;
    margin: 16px;
    margin-bottom: 20px;
    padding: 4px;
    background: #f0f0f0;
    border-radius: 12px;
    justify-content: center;
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 600;
    flex: 1;
    max-width: 120px;
}

.filter-btn:hover {
    background: rgba(0, 19, 56, 0.05);
}

.filter-btn.active {
    background: var(--primary-green);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 19, 56, 0.2);
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 16px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    font-weight: 500;
    color: var(--text-dark);
    background: var(--white);
    direction: rtl;
    text-align: right;
}

.search-input::placeholder {
    color: #999;
    opacity: 0.7;
    font-weight: 400;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.1);
    background: #fafafa;
}

.btn-search {
    background: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Form */
.form-container {
    background: var(--white);
    padding: 20px 16px;
    border-radius: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-col {
    display: flex;
    flex-direction: column;
}

.form-col label {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    display: block;
}

.btn-save {
    background: var(--primary-green);
    color: var(--white);
    margin-top: 24px;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    font-weight: 700;
    font-size: 16px;
    padding: 16px 24px;
    box-shadow: 0 4px 12px rgba(26, 95, 63, 0.3);
}

.btn-save:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(26, 95, 63, 0.3);
}

/* لیست قیمت‌ها */
.prices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.price-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    transition: all 0.2s;
}

.price-item:hover {
    background: #f8f9fa;
    border-color: var(--primary-green);
    box-shadow: 0 2px 4px rgba(26, 95, 63, 0.1);
}

.price-item-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
    flex: 1;
}

.price-item-value {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-green);
    direction: ltr;
    text-align: left;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.last-update {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-light);
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* لیست معاملات */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.transaction-item {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.transaction-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.transaction-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.transaction-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.transaction-type-badge.buy-type {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.transaction-type-badge.sell-type {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.transaction-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-green);
}

.transaction-status {
    background: var(--success);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-block;
}

.transaction-details {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.8;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-light);
    font-weight: 500;
    font-size: 12px;
}

.detail-value {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 13px;
    direction: ltr;
    text-align: left;
}

.product-name {
    font-weight: 600;
    color: var(--text-dark);
}

.transaction-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.action-icon {
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.action-icon:active {
    transform: scale(0.9);
}

/* منو */
.menu-section {
    padding: 24px 16px;
    background: #f5f5f5;
    min-height: calc(100vh - 60px - 80px);
}

.menu-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    margin-right: 4px;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}

.menu-item {
    background: var(--white);
    border: none;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 19, 56, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.menu-item:active::before {
    width: 300px;
    height: 300px;
}

.menu-item:hover {
    background: #fafafa;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.menu-item:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.menu-icon {
    font-size: 24px;
    color: var(--primary-green);
    display: inline-flex!important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(0, 19, 56, 0.08);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.menu-item:hover .menu-icon {
    background: rgba(0, 19, 56, 0.12);
    transform: scale(1.05);
}

.menu-item:active .menu-icon {
    transform: scale(0.95);
}

.menu-item span:nth-child(2) {
    flex: 1;
    color: var(--text-dark);
    font-weight: 500;
    letter-spacing: 0.2px;
}

.menu-item:hover span:nth-child(2) {
    color: var(--primary-green);
    font-weight: 600;
}

.menu-arrow {
    font-size: 20px;
    color: #bdbdbd;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: -4px;
}

.menu-item:hover .menu-arrow {
    color: var(--primary-green);
    transform: translateX(4px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 4px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    border-radius: 24px 24px 0 0;
    min-height: 50px;
}

.nav-item {
    background: transparent;
    border: none;
    color: #9E9E9E;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    position: relative;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.nav-item.active:not(.center-item) {
    color: #001338;
}

.nav-item.active:not(.center-item) .nav-icon {
    font-family: 'Material Icons';
}

.nav-item.center-item {
    margin-top: -18px;
}

.nav-item.center-item .nav-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #001338 0%, #001338 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
    margin-bottom: 2px;
}

.nav-item.center-item .nav-icon {
    color: var(--white);
    font-size: 22px;
}

.nav-item.center-item .nav-label {
    color:#001338;
    font-size: 10px;
    font-weight: 600;
    margin-top: 0;
}

.nav-icon {
    font-size: 20px;
    font-weight: normal;
    line-height: 1;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.nav-label {
    font-size: 9px;
    font-weight: 500;
    display: block;
    color: #9E9E9E;
    line-height: 1.2;
}

.nav-item.active:not(.center-item) .nav-label {
    color: #001338;
    font-weight: 600;
}

.nav-item:active:not(.center-item) {
    transform: scale(0.9);
}

.nav-item.center-item:active .nav-icon-wrapper {
    transform: scale(0.95);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state::before {
    content: '📋';
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .price-item {
        padding: 10px 14px;
        min-height: 44px;
    }
    
    .price-item-name,
    .price-item-value {
        font-size: 14px;
    }
    
    .nav-label {
        font-size: 10px;
    }
}

/* جلوگیری از zoom در iOS */
input[type="text"],
input[type="number"],
input[type="password"],
select {
    font-size: 16px !important;
}

/* صفحه پروفایل */
.profile-section {
    padding: 16px;
}

.profile-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

.info-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

/* صفحه تنظیمات */
.settings-section {
    padding: 16px;
}

.settings-list {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.setting-desc {
    display: block;
    font-size: 13px;
    color: var(--text-light);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-green);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Dark Mode */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .app-content {
    background: #1a1a1a;
}

body.dark-mode .content-page {
    background: #1a1a1a;
}

body.dark-mode .prices-section,
body.dark-mode .calculation-section,
body.dark-mode .history-section,
body.dark-mode .profile-card,
body.dark-mode .settings-list {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .form-control {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .form-control:focus {
    background: #333;
    border-color: var(--primary-green);
}

body.dark-mode .price-item,
body.dark-mode .transaction-item,
body.dark-mode .user-card {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .price-item:hover {
    background: #333;
    border-color: var(--primary-green);
}

body.dark-mode .price-item-name {
    color: #e0e0e0;
}

body.dark-mode .price-item-value {
    color: #4ade80;
}

body.dark-mode .info-label,
body.dark-mode .setting-desc {
    color: #aaa;
}

body.dark-mode .info-value,
body.dark-mode .setting-label {
    color: #e0e0e0;
}

/* بهبود ظاهر select */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 40px;
    padding-right: 16px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select.form-control:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a5f3f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* بهبود ظاهر input number */
input[type="number"].form-control::-webkit-inner-spin-button,
input[type="number"].form-control::-webkit-outer-spin-button {
    opacity: 1;
    height: 20px;
    width: 20px;
}

/* بهبود کلی ظاهر فرم */
.form-container .form-row:last-child {
    margin-bottom: 0;
}

/* بهبود placeholder */
input.form-control::placeholder,
select.form-control option:first-child {
    color: #999;
    opacity: 0.7;
}

/* بهبود focus state */
input.form-control:focus,
select.form-control:focus {
    border-width: 2px;
    border-color: var(--primary-green);
}

/* بهبود disabled state */
input.form-control[readonly] {
    background: #f9f9f9;
    color: var(--text-dark);
    cursor: default;
}

/* صفحه آب شده */
.melted-container {
    padding: 16px;
}

.price-card {
    background: var(--white);
    border: 2px solid var(--primary-green);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(26, 95, 63, 0.1);
}

.price-card-header {
    text-align: center;
    margin-bottom: 16px;
}

.price-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.buy-button {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(26, 95, 63, 0.3);
}

.buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 95, 63, 0.4);
}

.buy-button:active {
    transform: translateY(0);
}

.buy-label {
    font-size: 16px;
    opacity: 0.9;
}

.buy-price {
    font-size: 24px;
    font-weight: 900;
}

.sell-button {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'IRANSansX', 'Tahoma', 'Arial', sans-serif;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    margin-top: 15px;
}

.sell-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.sell-button:active {
    transform: translateY(0);
}

.sell-label {
    font-size: 16px;
    opacity: 0.9;
}

.sell-price {
    font-size: 24px;
    font-weight: 900;
}

.melted-form {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

/* Dark Mode برای صفحه آب شده */
body.dark-mode .price-card,
body.dark-mode .melted-form {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .price-label {
    color: #e0e0e0;
}

body.dark-mode .buy-button {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
}

body.dark-mode .sell-button {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

/* صفحه سکه */
.coin-container {
    padding: 1rem;
}

.coin-type-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.coin-type-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coin-type-btn:hover {
    background: #e8e8e8;
    border-color: var(--primary-green);
}

.coin-type-btn.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.coin-price-cards {
    margin-bottom: 1rem;
}

.coin-price-card {
    display: none;
}

.coin-price-card.active {
    display: block;
}

.coin-form {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Dark Mode برای صفحه سکه */
body.dark-mode .coin-type-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .coin-type-btn:hover {
    background: #333;
    border-color: var(--primary-green);
}

body.dark-mode .coin-type-btn.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

body.dark-mode .coin-form {
    background: #2a2a2a;
    border-color: #444;
}

/* استایل نمودار قیمت */
.chart-container {
    padding: 16px;
}

.chart-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chart-type-btn {
    background: var(--white);
    border: 2px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    font-weight: 600;
}

.chart-type-btn:hover {
    background: #f8f9fa;
    border-color: var(--primary-green);
}

.chart-type-btn.active {
    background: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

.price-chart-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.time-period-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.period-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
}

.period-btn::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    left: 0;
    height: 2px;
    background: var(--primary-green);
    opacity: 0;
    transition: opacity 0.3s;
}

.period-btn.active {
    color: var(--primary-green);
    font-weight: 700;
}

.period-btn.active::after {
    opacity: 1;
}

.current-price-section {
    margin-bottom: 24px;
}

.price-display {
    margin-bottom: 20px;
}

.price-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 8px;
    direction: ltr;
    text-align: left;
}

.price-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.price-sub-label {
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.7;
}

.chart-wrapper {
    height: 200px;
    position: relative;
    margin-top: 20px;
}

.price-stats {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    direction: ltr;
    text-align: center;
}

.stat-value.change-positive {
    color: var(--success);
}

.stat-value.change-negative {
    color: var(--danger);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
}

/* Dark Mode برای نمودار */
body.dark-mode .price-chart-card {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .chart-type-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .chart-type-btn:hover {
    background: #333;
}

body.dark-mode .chart-type-btn.active {
    background: var(--primary-green);
    color: white;
}

body.dark-mode .period-btn {
    color: #999;
}

body.dark-mode .period-btn.active {
    color: var(--primary-green);
}

body.dark-mode .price-value {
    color: #e0e0e0;
}

body.dark-mode .stat-value {
    color: #e0e0e0;
}

/* تایمر درخواست خرید */
.purchase-timer-container {
    margin-top: 20px;
}

.timer-card {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.timer-header {
    text-align: center;
    margin-bottom: 15px;
}

.timer-label {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
}

.timer-content {
    text-align: center;
}

.timer-display {
    font-size: 48px;
    font-weight: 900;
    color: var(--white);
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
    direction: ltr;
    display: inline-block;
}

.timer-status {
    color: var(--white);
    font-size: 14px;
    opacity: 0.9;
}

body.dark-mode .timer-card {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* صفحه تاریخچه خرید */
.purchases-container {
    padding: 20px;
    max-width: 100%;
}

.balance-section {
    margin-bottom: 32px;
}

.balance-section:last-child {
    margin-bottom: 0;
}

.balance-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.purchases-header {
    margin-bottom: 20px;
}

.purchases-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.purchases-summary {
    margin-bottom: 20px;
}

.summary-card {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(26, 95, 63, 0.2);
}

.summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
}

.last-update-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 8px;
}

.last-update-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
}

.last-update-value {
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
}

.summary-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
}

.summary-value {
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.summary-value.credit-value {
    color: #4ade80;
}

.summary-value.credit-value.negative {
    color: #f87171;
}

.summary-value.debit-value {
    color: #f87171;
}

.balance-item {
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: 8px;
    padding-top: 12px;
}

.balance-value {
    font-size: 22px;
    font-weight: 900;
}

.balance-value.positive {
    color: #4ade80;
}

.balance-value.negative {
    color: #f87171;
}

/* لیست تسویه‌ها */
.settlements-list-container {
    margin-top: 20px;
}

.settlements-title {
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.settlements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.settlement-item {
    background: var(--white);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-right: 4px solid #6c757d;
}

.settlement-item.cash {
    border-right-color: #28a745;
}

.settlement-item.physical {
    border-right-color: #17a2b8;
}

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

.settlement-type {
    font-weight: 600;
    font-size: 13px;
}

.settlement-type.cash {
    color: #28a745;
}

.settlement-type.physical {
    color: #17a2b8;
}

.settlement-date {
    font-size: 11px;
    color: var(--text-light);
}

.settlement-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
}

.settlement-detail {
    display: flex;
    gap: 4px;
}

.settlement-detail-label {
    color: var(--text-light);
}

.settlement-detail-value {
    font-weight: 600;
    color: var(--text-dark);
}

.no-settlements {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    padding: 16px;
}

/* Accordion Styles */
.accordion-container {
    margin-top: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--white);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
}

.accordion-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.accordion-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.accordion-icon {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.3s;
}

.accordion-container.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--white);
}

.accordion-container.open .accordion-content {
    max-height: 500px;
    overflow-y: auto;
}

.purchases-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.purchase-card {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.purchase-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.purchase-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.purchase-date {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.transaction-type {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
}

.transaction-type.buy-type {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.transaction-type.sell-type {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.purchase-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.purchase-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.purchase-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
}

.purchase-item.credit {
    background: #e8f5e9;
    border-right: 3px solid var(--success);
}

.purchase-item.debit {
    background: #ffebee;
    border-right: 3px solid var(--danger);
}

.purchase-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.purchase-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Courier New', monospace;
}

.purchase-item.credit .purchase-value {
    color: var(--success);
}

.purchase-item.debit .purchase-value {
    color: var(--danger);
}

body.dark-mode .purchase-card {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .purchase-item {
    background: #3a3a3a;
}

body.dark-mode .purchase-item.credit {
    background: rgba(16, 185, 129, 0.1);
}

body.dark-mode .purchase-item.debit {
    background: rgba(239, 68, 68, 0.1);
}

body.dark-mode .purchase-label {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .purchase-value {
    color: var(--white);
}

body.dark-mode .purchase-date {
    color: rgba(255, 255, 255, 0.6);
}

/* User Tracking Systems */
.tracking-container {
    padding: 16px;
}

.user-tracking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tracking-link-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tracking-link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tracking-link-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.tracking-link-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
}

.tracking-link-arrow {
    color: var(--text-light);
    font-size: 20px;
}
/* ========== صفحه حواله ========== */
.transfer-container {
    padding: 16px;
}

.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 1.5rem;
    color: #001338;
    margin-bottom: 8px;
}

.page-subtitle {
    color: #666;
    font-size: 0.85rem;
}

/* انتخاب نوع دارایی */
.asset-selector {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.asset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.asset-btn {
    flex: 1;
    min-width: 100px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.asset-btn.active {
    border-color: #001338;
    background: rgba(0, 19, 56, 0.05);
}

.asset-btn.disabled,
.asset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.asset-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.asset-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.asset-balance {
    display: block;
    font-size: 0.75rem;
    color: #666;
}

/* فرم حواله */
.transfer-form {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group .form-label {
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #001338;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    font-size: 0.7rem;
    color: #999;
    margin-top: 6px;
}

.btn-block {
    width: 100%;
    margin-top: 12px;
}

.btn-primary {
    background: #001338;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #002255;
}

/* تاریخچه حواله‌ها */
.transfers-history {
    margin-top: 24px;
}

.transfers-history h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #333;
}

.transfers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transfer-item {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.transfer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.transfer-asset {
    font-weight: 700;
    font-size: 1rem;
}

.transfer-asset.cash { color: #10b981; }
.transfer-asset.melted { color: #f59e0b; }
.transfer-asset.coin { color: #3b82f6; }

.transfer-status {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.transfer-status.pending {
    background: #fef3c7;
    color: #d97706;
}

.transfer-status.approved {
    background: #d1fae5;
    color: #059669;
}

.transfer-status.rejected {
    background: #fee2e2;
    color: #dc2626;
}

.transfer-details {
    font-size: 0.85rem;
    color: #555;
}

.transfer-detail-row {
    display: flex;
    margin-bottom: 8px;
}

.transfer-detail-label {
    width: 80px;
    font-weight: 500;
    color: #888;
}

.transfer-detail-value {
    flex: 1;
    color: #333;
}

.transfer-description {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
    font-size: 0.8rem;
    white-space: pre-wrap;
}

body.dark-mode .tracking-link-item {
    background: var(--dark-card);
}

body.dark-mode .tracking-link-name {
    color: var(--white);
}