/* === Global Styles & Resets === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Cairo', sans-serif; background: linear-gradient(135deg, #0f1419 0%, #1a237e 100%); min-height: 100vh; color: #ff9800; overflow-x: hidden; }

/* === Dashboard Layout === */
.dashboard-container { display: flex; height: 100vh; width: 100%; }
.sidebar { width: 280px; background: rgba(15, 20, 25, 0.9); padding: 30px; border-left: 1px solid rgba(255, 152, 0, 0.2); display: flex; flex-direction: column; align-items: center; flex-shrink: 0; transition: transform 0.3s ease-in-out; z-index: 1050; }
.sidebar .sidebar-logo { max-width: 150px; margin-bottom: 40px; }
.sidebar nav ul { list-style: none; padding: 0; width: 100%; }
.sidebar nav li { background: rgba(255, 255, 255, 0.05); padding: 15px; margin-bottom: 15px; border-radius: 8px; text-align: center; font-size: 18px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all 0.3s ease; }
.sidebar nav li:hover { background: rgba(255, 152, 0, 0.2); border-color: #ff9800; color: #fff; }
.sidebar nav a { color: inherit; text-decoration: none; display: block; }
.sidebar nav .active { background: rgba(255, 152, 0, 0.2); }

/* <<< === التعديل الجذري هنا === >>> */
.main-content { 
    flex-grow: 1; /* يأخذ باقي المساحة المتاحة */
    height: 100vh; 
    overflow-y: auto; 
    /* هذا الكود الجديد سيقوم بتوسيط المحتوى أفقيًا */
    display: flex;
    justify-content: center; /* يضع ال container في المنتصف */
    padding: 50px 20px; /* يضيف هوامش علوية وجانبية للمحتوى */
}

/* === General Content & Containers === */
/* <<< تم تعديل العرض هنا ليكون مناسبًا للابتوب >>> */
.container { 
    width: 100%;
    max-width: 1100px; /* عرض أوسع ومناسب للابتوب */
    margin: 0; /* لم نعد بحاجة لـ margin auto */
}

header { text-align: center; margin-bottom: 40px; }
header h2 { font-size: 28px; color: #ffcc80; font-weight: 700; }
header p { font-size: 20px; color: #ffcc80; font-weight: 400; font-style: italic; margin-top: 10px; }
.form-container { background: rgba(15, 20, 25, 0.9); padding: 30px; border-radius: 15px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); border: 1px solid rgba(255, 152, 0, 0.2); }
label { display: block; margin-bottom: 8px; color: #ff9800; font-weight: 600; }
textarea, input[type="text"], input[type="password"], input[type="number"], input[type="url"], select { width: 100%; padding: 12px 15px; border: 1px solid rgba(255, 152, 0, 0.3); border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: #fff; font-size: 16px; margin-bottom: 20px; font-family: 'Cairo', sans-serif; transition: all 0.3s ease; }
select option { background: #0f1419; color: #f0f0f0; }
textarea { min-height: 150px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #ff9800; box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.3); }
.checkbox-group { display: flex; gap: 20px; margin-bottom: 20px; align-items: center; }
.checkbox-group input { width: auto; margin-bottom: 0; }
.checkbox-group label { margin-bottom: 0; font-weight: normal; }
button { background: linear-gradient(135deg, #ff9800 0%, #ff6f00 100%); color: #fff; border: none; padding: 15px 40px; border-radius: 25px; font-size: 18px; font-weight: 700; cursor: pointer; display: block; margin: 20px auto 0; transition: all 0.3s ease; font-family: 'Cairo', sans-serif; box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4); }
button:hover { background: linear-gradient(135deg, #fb8c00 0%, #e65100 100%); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6); }
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.action-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.success-btn { background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%); width: auto; }
.secondary-btn { background: linear-gradient(135deg, #37474f 0%, #546e7a 100%); width: auto; }
.bot-card { background: rgba(30, 39, 50, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 20px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.bot-info { display: flex; flex-direction: column; gap: 8px; }
.bot-info h4 { color: #fff; font-size: 18px; margin: 0; }
.bot-info .bot-id { color: #8a96a8; font-size: 12px; font-family: monospace; }
.bot-types { display: flex; gap: 8px; }
.bot-type-tag { background: rgba(255, 255, 255, 0.1); color: #c0c0c0; padding: 4px 10px; border-radius: 15px; font-size: 12px; }
.bot-type-tag.active { background: #0288d1; color: #fff; font-weight: bold; }
.bot-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bot-actions button { padding: 8px 15px; font-size: 14px; border-radius: 6px; margin: 0; background: #0288d1; box-shadow: none; }
.bot-actions button.delete-btn { background: #d32f2f; }
.bot-actions button:hover { transform: translateY(-1px); opacity: 0.9; }
.language-switcher { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255, 152, 0, 0.1); display: flex; gap: 10px; width: 100%; justify-content: center; }
.language-switcher button { background: none; border: 1px solid #ff9800; color: #ff9800; padding: 5px 10px; font-size: 14px; border-radius: 5px; cursor: pointer; width: auto; margin: 0; box-shadow: none; flex-grow: 1; }
.language-switcher button.active { background: #ff9800; color: #0f1419; font-weight: bold; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #0f1419; padding: 30px; border-radius: 15px; border: 1px solid rgba(255, 152, 0, 0.2); width: 90%; max-width: 700px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); animation: fadeInModal 0.3s ease-out; display: flex; flex-direction: column; }
@keyframes fadeInModal { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(255, 152, 0, 0.2); flex-shrink: 0; }
.modal-header h3 { color: #ffcc80; font-size: 22px; }
.modal-close-btn { background: none; border: none; color: #aaa; font-size: 32px; cursor: pointer; padding: 0; margin: 0; box-shadow: none; line-height: 1; }
.modal-close-btn:hover { color: #ff9800; }
.modal-body { max-height: 70vh; overflow-y: auto; padding-right: 15px; }
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(30, 39, 50, 0.9); color: #fff; padding: 15px 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); border: 1px solid; display: flex; align-items: center; gap: 10px; animation: slideInToast 0.4s ease-out, fadeOutToast 0.4s ease-in 4s forwards; }
.toast.success { border-color: #4caf50; }
.toast.error { border-color: #d32f2f; }
@keyframes slideInToast { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOutToast { from { opacity: 1; } to { opacity: 0; } }
.loading { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s ease-in-out infinite; margin-left: 10px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-menu-btn { display: none; position: fixed; top: 15px; right: 15px; z-index: 1100; background: rgba(15, 20, 25, 0.8); color: #ff9800; border: 1px solid rgba(255, 152, 0, 0.3); width: 50px; height: 50px; font-size: 28px; border-radius: 50%; box-shadow: 0 4px 15px rgba(0,0,0,0.4); justify-content: center; align-items: center; }
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .sidebar { position: fixed; top: 0; right: 0; height: 100%; transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { padding: 20px 10px; justify-content: flex-start; }
    .container { padding: 0; }
    header h2 { font-size: 22px; }
    header p { font-size: 16px; }
    .form-container { padding: 20px; }
    .bot-card { flex-direction: column; align-items: flex-start; }
    .bot-actions { justify-content: flex-start; width: 100%; }
    .bot-actions button { flex-grow: 1; text-align: center; }
    button { font-size: 16px; padding: 12px 30px; }
    .modal-content { padding: 20px; }
    .modal-header h3 { font-size: 20px; }
}