:root {
    --primary-orange: #FF6B00;
    --bg-dark: #121212; 
    --card-dark: #1E1E1E; 
    --text-dark: #E0E0E0;
    --bg-light: #F4F4F4; 
    --card-light: #FFFFFF; 
    --text-light: #1A1A1A;
    --gray: #444;
}

/* تعديل الـ body لدعم الفوتر الملتصق بالأسفل */
body { 
    margin: 0; 
    font-family: 'Segoe UI', Tahoma, sans-serif; 
    transition: 0.3s; 
    display: flex; 
    flex-direction: column; /* ترتيب العناصر عمودياً */
    align-items: center; 
    min-height: 100vh; /* جعل الصفحة تأخذ كامل ارتفاع الشاشة */
    overflow-y: auto; 
    padding: 0; 
    box-sizing: border-box;
}

body.dark-mode { background-color: var(--bg-dark); color: var(--text-dark); }
body.light-mode { background-color: var(--bg-light); color: var(--text-light); }

/* شريط التحكم العلوي */
.mode-lang-ctrl { 
    width: 100%;
    padding: 20px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    box-sizing: border-box;
    z-index: 100;
}

.ctrl-group {
    display: flex;
    gap: 8px;
}

.mini-btn { 
    background: rgba(128,128,128,0.2); 
    border: 1px solid #555; 
    color: inherit; 
    padding: 6px 12px; 
    font-size: 12px; 
    border-radius: 4px; 
    cursor: pointer; 
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: 0.3s;
}

.mini-btn:hover {
    background: rgba(255, 107, 0, 0.2);
    border-color: var(--primary-orange);
}

/* الشعار العلوي للهوية */
.logo-box-top {
    margin-top: 10px;
    margin-bottom: 20px;
}

.logo-box-top img { 
    max-width: 160px; 
}

/* الحاوية (الكونتينة) */
.container { 
    padding: 2rem; 
    border-radius: 20px; 
    width: 90%; 
    max-width: 650px; 
    text-align: center; 
    position: relative; 
    transition: 0.3s; 
    margin-bottom: 40px; /* مسافة قبل الفوتر */
}

body.dark-mode .container { background: var(--card-dark); box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
body.light-mode .container { background: var(--card-light); box-shadow: 0 10px 40px rgba(0,0,0,0.1); }

/* تنسيق أيقونة الـ SVG داخل الحاوية */
.app-header-inside {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    padding-bottom: 15px;
}

.app-icon-wrapper {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    color: var(--primary-orange);
}

.app-icon-wrapper svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

#app-title-name {
    font-size: 1.3rem;
    margin: 0;
    color: var(--primary-orange);
    font-weight: bold;
}

/* تبويبات الأداة */
.tabs-wrapper { 
    overflow-x: auto; 
    white-space: nowrap; 
    margin-bottom: 20px; 
    border-bottom: 1px solid var(--gray); 
    scrollbar-width: none; 
}

.tab { 
    display: inline-block; 
    padding: 12px 20px; 
    cursor: pointer; 
    font-size: 14px; 
    color: #888; 
    transition: 0.2s; 
}

.tab.active { 
    color: var(--primary-orange); 
    border-bottom: 3px solid var(--primary-orange); 
    font-weight: bold; 
}

.input-group { display: none; text-align: right; }
html[dir="ltr"] .input-group { text-align: left; }
.input-group.active { display: block; }

.grid-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

input, textarea {
    width: 100%; 
    padding: 10px; 
    margin: 8px 0; 
    border: 1px solid #555; 
    border-radius: 6px;
    background: rgba(255,255,255,0.05); 
    color: inherit; 
    box-sizing: border-box; 
    font-size: 14px;
}

button { 
    background: var(--primary-orange); 
    color: white; 
    border: none; 
    padding: 13px; 
    border-radius: 8px; 
    cursor: pointer; 
    width: 100%; 
    font-weight: bold; 
    margin-top: 15px; 
    transition: 0.3s;
}

button:hover {
    filter: brightness(1.2);
}

#qr-display { 
    margin-top: 25px; 
    background: white; 
    padding: 15px; 
    border-radius: 10px; 
    display: none; 
    justify-content: center;
}

.download-area { 
    display: none; 
    gap: 10px; 
    margin-top: 20px; 
    width: 100%; 
}

#login-screen, #app-screen { display: none; }
.visible { display: block !important; }

label { 
    font-size: 12px; 
    color: var(--primary-orange); 
    display: block; 
    margin-top: 10px; 
    font-weight: bold; 
}

/* الفوتر الموحد (النسخة المطورة والمستقلة) */
.main-footer {
    margin-top: auto; /* دفع الفوتر للأسفل */
    padding: 40px 0 20px 0;
    text-align: center;
    width: 100%;
    border-top: 1px solid rgba(128, 128, 128, 0.1);
}

.main-footer a {
    text-decoration: none;
    font-size: 0.85rem;
    color: inherit;
    opacity: 0.7;
    transition: 0.3s;
}

.main-footer a:hover { 
    opacity: 1; 
    color: var(--primary-orange); 
}