/* --- القواعد العامة والتناسق --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: #121212;
    color: #ffffff;
    line-height: 1.6;
    padding: 30px 0;
}

.container {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
}

/* --- زر العودة --- */
.back-to-menu {
    margin-bottom: 20px;
}
.back-to-menu a {
    color: #D4AF37;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}
.back-to-menu a:hover {
    color: #f3cd57;
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

/* --- كارت الروشتة الرئيسي --- */
.prescription-card {
    background-color: #1a1a1a;
    border: 2px solid #D4AF37;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    position: relative;
}

/* الفواصل المميّزة للروشتات */
.prescription-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to left, transparent, #D4AF37, transparent);
    margin: 25px 0;
}

/* --- الهيدر (رأس الروشتة) --- */
.prescription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clinic-info h1 {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 5px;
}

.clinic-info p {
    color: #D4AF37;
    font-size: 15px;
    font-weight: 700;
}

.clinic-info small {
    color: #b3b3b3;
    display: block;
    margin-top: 3px;
}

.rx-symbol span {
    font-size: 55px;
    font-weight: 900;
    color: rgba(212, 175, 55, 0.2);
    font-family: serif;
}

/* --- العناوين الداخلية --- */
.section-title {
    font-size: 18px;
    color: #D4AF37;
    margin-bottom: 15px;
    font-weight: 700;
}

/* --- حقول الإدخال والـ Form --- */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    color: #b3b3b3;
    font-weight: 500;
}

.input-group input {
    background-color: #222222;
    border: 1px solid #333333;
    padding: 12px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.full-width {
    margin-top: 5px;
}

/* --- كروت المنتجات المصغرة المضبوطة جداً --- */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px; /* لضمان عدم الطول الزائد وإحداث كركبة */
    overflow-y: auto;
    padding-left: 5px;
}

/* كارت المنتج في الروشتة */
.item-mini-card {
    display: flex;
    align-items: center;
    background-color: #222222;
    border: 1px solid #2e2e2e;
    border-radius: 10px;
    padding: 10px 15px;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.item-mini-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    background-color: #262626;
}

.item-details-block {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #333;
}

.item-info-text .item-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.item-info-text .item-meta {
    font-size: 13px;
    color: #b3b3b3;
}

.item-pricing-block {
    text-align: left;
}

.item-pricing-block .item-total-price {
    font-size: 16px;
    font-weight: 900;
    color: #D4AF37;
}

/* --- ملخص الحسابات --- */
.prescription-summary {
    background-color: rgba(212, 175, 55, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #b3b3b3;
}

.badge-gold {
    background-color: #D4AF37;
    color: #121212;
    padding: 3px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 12px;
}

.total-price-row {
    border-top: 1px dashed rgba(212, 175, 55, 0.3);
    padding-top: 10px;
    font-size: 18px;
    color: #ffffff;
    font-weight: bold;
}

#grand-total-price {
    font-size: 22px;
    font-weight: 900;
    color: #D4AF37;
}

/* --- الفوتر وزر الإرسال --- */
.prescription-footer {
    text-align: center;
    margin-top: 25px;
}

.disclaimer {
    font-size: 13px;
    color: #e74c3c;
    margin-bottom: 15px;
}

.submit-prescription-btn {
    background-color: #D4AF37;
    color: #121212;
    border: none;
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 900;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.submit-prescription-btn:hover {
    background-color: #f3cd57;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* --- شريط التنبيهات (Toast Notifications) --- */
#toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #1a1a1a;
    border-right: 4px solid #e74c3c;
    color: #fff;
    padding: 15px 25px;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    font-weight: bold;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* التجاوب مع الموبايل */
@media (max-width: 600px) {
    .input-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .prescription-card {
        padding: 15px;
    }
    .clinic-info h1 {
        font-size: 20px;
    }
}