:root {
    --bg-dark: #050505;
    --panel-bg: rgba(15, 5, 5, 0.85);
    --primary-red: #ff003c;
    --dark-red: #8b0000;
    --text-light: #e0e0e0;
    --border-color: rgba(255, 0, 60, 0.3);
}

/* ============================================
   🔒 حماية الموقع من النسخ والسرقة
   ============================================ */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* السماح بالتحديد في حقول الإدخال فقط */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Tajawal', sans-serif; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-dark); color: var(--text-light);
    min-height: 100vh; display: flex; justify-content: center; align-items: center;
    overflow-x: hidden; position: relative;
}

.cyber-grid {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(255, 0, 60, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 0, 60, 0.05) 1px, transparent 1px);
    background-size: 30px 30px; z-index: 1; pointer-events: none;
}

.container { position: relative; z-index: 2; width: 100%; max-width: 420px; padding: 20px; }

.panel {
    background: var(--panel-bg); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 30px 25px;
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.1), inset 0 0 10px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    
    /* تم تغييرها لتعمل كصفحة مستقلة وتظهر دائماً بشكل سلس */
    display: block;
    animation: fadeInSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInSlideUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.panel-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 15px;
}

.status-dot {
    width: 10px; height: 10px; background-color: var(--primary-red);
    border-radius: 50%; box-shadow: 0 0 8px var(--primary-red);
}
.status-dot.pulse { animation: pulseRed 1.5s infinite; }

h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: 1px; color: #fff; }
.section-title { font-size: 1.1rem; color: var(--primary-red); margin: 20px 0 15px; border-right: 3px solid var(--primary-red); padding-right: 10px; }

.input-group { position: relative; margin-bottom: 25px; }
.input-group input, .cyber-select {
    width: 100%; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; padding: 14px 15px; border-radius: 8px; font-size: 1rem; outline: none; transition: 0.3s ease;
}
.cyber-select { appearance: none; cursor: pointer; }
.cyber-select option { background: var(--bg-dark); color: #fff; }
.input-group label {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.4); font-size: 0.95rem; pointer-events: none; transition: 0.3s ease;
}
.input-group input:focus, .input-group input:not(:placeholder-shown) { border-color: var(--primary-red); box-shadow: 0 0 10px rgba(255, 0, 60, 0.2); }
.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label {
    top: 0; right: 10px; font-size: 0.75rem; background: var(--bg-dark); padding: 0 5px; color: var(--primary-red);
}

.file-upload-wrapper { position: relative; margin-bottom: 25px; }
.file-input { display: none; }
.file-label {
    display: block; width: 100%; padding: 20px; background: rgba(255, 0, 60, 0.05);
    border: 1px dashed var(--primary-red); border-radius: 8px; text-align: center; color: rgba(255,255,255,0.7);
    cursor: pointer; transition: 0.3s; font-size: 0.9rem;
}
.file-label:hover { background: rgba(255, 0, 60, 0.1); box-shadow: 0 0 15px rgba(255, 0, 60, 0.2); }

.cyber-btn {
    width: 100%; padding: 14px; background: transparent; border: 1px solid var(--primary-red);
    color: var(--primary-red); border-radius: 8px; font-size: 1.1rem; font-weight: bold; cursor: pointer;
    position: relative; overflow: hidden; transition: 0.3s; margin-top: 10px;
}
.cyber-btn span { position: relative; z-index: 2; }
.cyber-btn::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--primary-red);
    transform: scaleX(0); transform-origin: right; transition: transform 0.3s ease; z-index: 1;
}
.cyber-btn:hover::before { transform: scaleX(1); }
.cyber-btn:hover { color: #fff; box-shadow: 0 0 15px rgba(255, 0, 60, 0.4); }

.switch-txt { text-align: center; margin-top: 25px; font-size: 0.9rem; color: rgba(255,255,255,0.5); }
.switch-txt a { color: var(--primary-red); text-decoration: none; font-weight: bold; margin-right: 5px; transition: 0.3s; }
.switch-txt a:hover { text-shadow: 0 0 8px rgba(255,0,60,0.6); }

.error-msg { color: var(--primary-red); font-size: 0.85rem; text-align: center; min-height: 20px; margin-bottom: 15px; }

.user-greeting { margin-bottom: 25px; font-size: 0.95rem; color: rgba(255,255,255,0.7); text-align: center; }
.highlight { color: var(--primary-red); font-weight: bold; }
.serial-wrapper { margin-bottom: 25px; }
.serial-input {
    width: 100%; background: rgba(255, 0, 60, 0.05); border: 1px dashed var(--primary-red); color: #fff;
    padding: 15px; text-align: center; font-family: monospace; font-size: 1.2rem; letter-spacing: 3px; border-radius: 8px; outline: none; transition: 0.3s;
}
.serial-input:focus { background: rgba(255, 0, 60, 0.1); box-shadow: 0 0 15px rgba(255, 0, 60, 0.2); border-style: solid; }

.logout-btn-top {
    position: absolute; top: 20px; left: 20px; z-index: 10;
    background: rgba(255,0,0,0.1); color: var(--primary-red); border: 1px solid var(--primary-red);
    padding: 8px 15px; border-radius: 5px; cursor: pointer; transition: 0.3s;
}
.logout-btn-top:hover { background: var(--primary-red); color: #fff; }

@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(255, 0, 60, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(255, 0, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 0, 60, 0); } }

/* ====== الفوتر السيبراني ====== */
.cyber-footer {
    text-align: center;
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #666;
}
.cyber-footer p { margin-bottom: 8px; }
.cyber-footer .support-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid rgba(255,0,60,0.3);
    border-radius: 4px;
    background: rgba(255,0,60,0.05);
    transition: 0.3s;
}
.cyber-footer .support-link:hover {
    background: rgba(255,0,60,0.15);
    box-shadow: 0 0 10px rgba(255,0,60,0.2);
}
.cyber-footer .copyright {
    font-size: 0.75rem;
    color: #444;
    letter-spacing: 1px;
}

@media (max-width: 400px) { .panel { padding: 25px 20px; border-radius: 8px; } h2 { font-size: 1.2rem; } .serial-input { font-size: 1.1rem; letter-spacing: 2px; padding: 12px;} }
