/* ============================================
   تنسيقات صفحات العملات (الرئيسية والفرعية)
   ============================================ */

.currency-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 90px 20px 20px 20px;
}

.currency-header-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 25px;
}
.currency-header-wrapper h1 {
    font-size: 2rem;
    color: #2563eb;
    margin: 0;
    font-weight: 700;
}
body.dark-mode .currency-header-wrapper h1 {
    color: #60a5fa;
}
.currency-header-wrapper .sub-description {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.7;
    margin: 0;
    max-width: 750px;
}
body.dark-mode .currency-header-wrapper .sub-description {
    color: #cbd5e0;
}

.currency-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: center;
    margin: 10px 0 25px 0;
    padding: 15px 20px;
    background: #f0f7ff;
    border-radius: 12px;
    align-items: center;
}
body.dark-mode .currency-quick-links {
    background: #1e293b;
}
.currency-quick-links .link-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.currency-quick-links .link-group-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4b5563;
    display: flex;
    align-items: center;
    margin-left: 4px;
}
body.dark-mode .currency-quick-links .link-group-label {
    color: #9ca3af;
}
.currency-quick-links a {
    background: #2563eb;
    color: white;
    padding: 6px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: inline-block;
    white-space: nowrap;
}
.currency-quick-links a:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
body.dark-mode .currency-quick-links a:hover {
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
}
.currency-quick-links a.sar-link {
    background: #059669;
}
.currency-quick-links a.sar-link:hover {
    background: #047857;
}

.currency-converter {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px 30px 30px 30px;
    margin: 25px 0 35px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}
body.dark-mode .currency-converter {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.currency-converter .converter-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}
.currency-converter .converter-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.currency-converter .converter-row .converter-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.95rem;
    min-width: 70px;
    flex-shrink: 0;
    text-align: right;
}
body.dark-mode .currency-converter .converter-row .converter-label {
    color: #cbd5e0;
}
.currency-converter .converter-row .converter-field {
    flex: 1;
    min-width: 0;
    width: 100%;
    overflow: visible;
}

/* التعديل الأساسي: إصلاح ظهور النص داخل select */
.currency-converter .converter-row .converter-field select,
.currency-converter .converter-row .converter-field input {
    width: 100%;
    padding: 14px 16px;               /* زيادة padding قليلاً */
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    color: #1e293b;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    min-height: 60px;                 /* زيادة الارتفاع الأدنى */
    min-width: 0;
    max-width: 100%;
    line-height: 1.5;                 /* ضبط تباعد الأسطر */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* إضافة سهم مخصص للـ select */
.currency-converter .converter-row .converter-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px;
    padding-left: 40px;
    padding-right: 16px;
    direction: rtl;
}

/* دعم الوضع الليلي للسهم */
body.dark-mode .currency-converter .converter-row .converter-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

body.dark-mode .currency-converter .converter-row .converter-field select,
body.dark-mode .currency-converter .converter-row .converter-field input {
    background-color: #1e293b;
    border-color: #4a5568;
    color: #f7fafc;
}

/* خيارات القائمة */
.currency-converter .converter-row .converter-field select option {
    padding: 10px 12px;
    background: #fff;
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.6;
    min-height: 40px;
}
body.dark-mode .currency-converter .converter-row .converter-field select option {
    background: #1e293b;
    color: #f7fafc;
}

.currency-converter .converter-btn {
    padding: 12px 30px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Cairo', sans-serif;
    width: 100%;
}
.currency-converter .converter-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
body.dark-mode .currency-converter .converter-btn:hover {
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
}
.currency-converter .converter-result-box {
    margin-top: 20px;
    padding: 18px 22px;
    background: #f0f7ff;
    border-radius: 12px;
    border-right: 5px solid #2563eb;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    transition: all 0.3s;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}
body.dark-mode .currency-converter .converter-result-box {
    background: #1e293b;
    color: #f7fafc;
    border-right-color: #3b82f6;
}
.currency-converter .converter-result-box .result-value {
    color: #2563eb;
    font-size: 1.5rem;
    font-weight: 700;
}
body.dark-mode .currency-converter .converter-result-box .result-value {
    color: #60a5fa;
}
.currency-converter .converter-result-box .result-note {
    font-size: 0.85rem;
    font-weight: 400;
    color: #6b7280;
}
body.dark-mode .currency-converter .converter-result-box .result-note {
    color: #9ca3af;
}
.currency-converter .converter-result-box .error-msg {
    color: #dc2626;
    font-weight: 500;
}

/* بقية التنسيقات كما هي دون تغيير */
.currency-sub-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}
.currency-sub-page .sub-header {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 4px solid #2563eb;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
body.dark-mode .currency-sub-page .sub-header {
    background: #1f2937;
    border-bottom-color: #60a5fa;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.currency-sub-page .sub-header h1 {
    font-size: 2rem;
    color: #1e3a8a;
    margin: 0 0 10px 0;
}
body.dark-mode .currency-sub-page .sub-header h1 {
    color: #93c5fd;
}
.currency-sub-page .sub-header .update-time {
    color: #6b7280;
    font-size: 0.9rem;
}
body.dark-mode .currency-sub-page .sub-header .update-time {
    color: #9ca3af;
}
.currency-sub-page .price-display {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
body.dark-mode .currency-sub-page .price-display {
    background: #1f2937;
    border-color: #374151;
}
.currency-sub-page .price-row-large {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 15px;
}
body.dark-mode .currency-sub-page .price-row-large {
    background: #1e293b;
}
.currency-sub-page .price-row-large .label {
    font-weight: 600;
    font-size: 1.1rem;
}
.currency-sub-page .price-row-large .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}
body.dark-mode .currency-sub-page .price-row-large .value {
    color: #60a5fa;
}
.currency-sub-page .buy-row-border {
    border-right: 4px solid #2563eb;
}
.currency-sub-page .sell-row-border {
    border-right: 4px solid #f97316;
}

.currency-sub-page .sub-quick-links {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    text-align: center;
}
body.dark-mode .currency-sub-page .sub-quick-links {
    background: #1e293b;
}
.currency-sub-page .sub-quick-links p {
    font-weight: 600;
    margin-bottom: 10px;
}
.currency-sub-page .sub-quick-links .links-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.currency-sub-page .sub-quick-links a {
    background: #2563eb;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}
.currency-sub-page .sub-quick-links a:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}
.currency-sub-page .sub-quick-links a.all-link {
    background: #6b7280;
}
.currency-sub-page .sub-quick-links a.all-link:hover {
    background: #4b5563;
}
.currency-sub-page .back-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #2563eb;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.3s;
}
.currency-sub-page .back-link:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}
.city-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
body.dark-mode .city-card {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.city-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
body.dark-mode .city-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.city-card .city-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}
body.dark-mode .city-card .city-header {
    border-bottom-color: #374151;
}
.city-card .city-icon {
    font-size: 2rem;
}
.city-card .city-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
}
body.dark-mode .city-card .city-name {
    color: #93c5fd;
}
.city-card .city-desc {
    color: #718096;
    font-size: 0.9rem;
    margin-right: auto;
}
body.dark-mode .city-card .city-desc {
    color: #9ca3af;
}
.city-card .price-section {
    margin-bottom: 15px;
}
.city-card .price-type {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #64748b;
}
.city-card .buy-type .price-type {
    color: #2563eb;
}
.city-card .sell-type .price-type {
    color: #f97316;
}
body.dark-mode .city-card .buy-type .price-type {
    color: #60a5fa;
}
body.dark-mode .city-card .sell-type .price-type {
    color: #fb923c;
}
.city-card .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
}
body.dark-mode .city-card .price-row {
    background: #1e293b;
}
.city-card .buy-row {
    border-right: 4px solid #2563eb;
}
.city-card .sell-row {
    border-right: 4px solid #f97316;
}
body.dark-mode .city-card .buy-row {
    border-right-color: #3b82f6;
}
body.dark-mode .city-card .sell-row {
    border-right-color: #fb923c;
}
.city-card .price-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2563eb;
}
body.dark-mode .city-card .price-value {
    color: #60a5fa;
}

.disclaimer {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    text-align: center;
}
body.dark-mode .disclaimer {
    background: #7c5e10;
    border-color: #9c7e1a;
    color: #ffecb3;
}

.loading-state {
    text-align: center;
    padding: 50px;
}
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}
body.dark-mode .loading-spinner {
    border-color: #4a5568;
    border-top-color: #60a5fa;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.article-frame {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 30px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
body.dark-mode .article-frame {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.article-frame h3 {
    color: #1e3a8a;
    margin-bottom: 20px;
    font-size: 1.3rem;
}
body.dark-mode .article-frame h3 {
    color: #93c5fd;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.related-card {
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s;
    border: 1px solid #e2e8f0;
}
body.dark-mode .related-card {
    background: #1e293b;
    border-color: #374151;
}
.related-card:hover {
    transform: translateY(-3px);
}
.related-card h4 {
    padding: 15px 15px 5px;
    font-size: 1rem;
    color: #1e293b;
}
body.dark-mode .related-card h4 {
    color: #f7fafc;
}
.related-card .snippet {
    padding: 0 15px 10px;
    font-size: 0.85rem;
    color: #718096;
}
body.dark-mode .related-card .snippet {
    color: #9ca3af;
}
.views-count {
    padding: 0 15px 15px;
    font-size: 0.8rem;
    color: #718096;
}
body.dark-mode .views-count {
    color: #9ca3af;
}

@media (max-width: 768px) {
    .currency-container {
        padding: 80px 15px 20px 15px;
    }
    .currency-header-wrapper h1 {
        font-size: 1.6rem;
    }
    .currency-header-wrapper .sub-description {
        font-size: 0.95rem;
    }
    .currency-converter {
        padding: 20px;
    }
    .currency-converter .converter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .currency-converter .converter-row .converter-label {
        min-width: auto;
        text-align: right;
        font-size: 0.85rem;
    }
    .currency-converter .converter-row .converter-field select,
    .currency-converter .converter-row .converter-field input {
        padding: 14px 16px;
        font-size: 0.95rem;
        min-height: 56px;   /* زيادة الارتفاع للشاشات المتوسطة */
        width: 100%;
    }
    .currency-converter .converter-row .converter-field select option {
        font-size: 0.95rem;
        padding: 10px 12px;
    }
    .currency-converter .converter-btn {
        font-size: 1rem;
        min-height: 48px;
    }
    .currency-converter .converter-result-box {
        font-size: 1.1rem;
        padding: 16px;
        min-height: 50px;
    }
    .currency-converter .converter-result-box .result-value {
        font-size: 1.3rem;
    }
    .cities-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .currency-sub-page .sub-header h1 {
        font-size: 1.5rem;
    }
    .currency-sub-page .price-row-large {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    .currency-sub-page .price-row-large .value {
        font-size: 1.3rem;
    }
    .currency-sub-page .sub-quick-links .links-wrap {
        flex-direction: column;
        align-items: center;
    }
    .currency-sub-page .sub-quick-links a {
        width: 100%;
        text-align: center;
    }
    .currency-quick-links a {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .currency-container {
        padding: 70px 10px 15px 10px;
    }
    .currency-header-wrapper h1 {
        font-size: 1.4rem;
    }
    .currency-header-wrapper .sub-description {
        font-size: 0.9rem;
    }
    .currency-converter {
        padding: 15px;
        margin: 15px 0 20px 0;
    }
    .currency-converter .converter-row .converter-field select,
    .currency-converter .converter-row .converter-field input {
        padding: 12px 14px;
        font-size: 0.9rem;
        min-height: 52px;   /* زيادة الارتفاع للهواتف الصغيرة */
    }
    .currency-converter .converter-row .converter-field select option {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
    .currency-converter .converter-btn {
        font-size: 0.95rem;
        min-height: 44px;
        padding: 10px;
    }
    .currency-converter .converter-result-box {
        font-size: 1rem;
        padding: 14px;
        min-height: 45px;
    }
    .currency-converter .converter-result-box .result-value {
        font-size: 1.2rem;
    }
    .currency-quick-links {
        gap: 8px;
        padding: 12px;
    }
    .currency-quick-links a {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    .currency-quick-links .link-group-label {
        font-size: 0.75rem;
    }
    .currency-sub-page .sub-header {
        padding: 20px;
    }
    .currency-sub-page .sub-header h1 {
        font-size: 1.3rem;
    }
    .currency-sub-page .price-display {
        padding: 18px;
    }
    .currency-sub-page .price-row-large {
        padding: 12px 15px;
    }
    .currency-sub-page .price-row-large .value {
        font-size: 1.2rem;
    }
}
@media (min-width: 1200px) {
    .currency-container {
        max-width: 1400px;
    }
}