/* ============================================
   تصميم صفحة تسجيل الدخول الاحترافية
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   الحاوية الرئيسية ومحتوى الصفحة
   ============================================ */

.login-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* الخلفية المتدرجة */
.gradient-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #2c1810 0%,      /* بني داكن */
        #4a3728 25%,     /* بني متوسط */
        #1e4d7b 50%,     /* أزرق */
        #2a5a8d 75%,     /* أزرق فاتح */
        #3a6b9e 100%);   /* أزرق فاتح جداً */
    background-attachment: fixed;
    z-index: 1;
}

/* إضافة تأثير ضوئي متحرك */
.gradient-background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: luminousWave 15s ease-in-out infinite;
    z-index: 0;
}

@keyframes luminousWave {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* محتوى الصفحة */
.login-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 90%;
    max-width: 1200px;
    padding: 20px;
    align-items: center;
}

/* ============================================
   قسم نموذج تسجيل الدخول
   ============================================ */

.login-form-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* تأثير Glass Morphism */
.glass-morphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

/* لمعان الحافة */
.glass-morphism::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    border-radius: 20px 20px 0 0;
}

.form-wrapper {
    padding: 50px;
    width: 100%;
    max-width: 450px;
}

/* رأس النموذج */
.form-header {
    text-align: center;
    margin-bottom: 40px;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    direction: rtl;
}

.form-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    direction: rtl;
}

/* الرسائل - نجاح/خطأ */
.alert {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    direction: rtl;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.4);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.4);
}

.alert .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* نموذج تسجيل الدخول */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* مجموعة النموذج */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideIn 0.5s ease-out;
}

.form-label {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    direction: rtl;
}

/* حقول الإدخال */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.input-wrapper.focused {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.input-icon {
    color: rgba(255, 255, 255, 0.6);
    margin-left: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-wrapper.focused .input-icon {
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.glass-input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 15px;
    padding: 14px 0;
    flex: 1;
    outline: none;
    transition: all 0.3s ease;
    direction: rtl;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.glass-input:focus {
    box-shadow: none;
}

.glass-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.08) inset;
    -webkit-text-fill-color: #ffffff;
}

/* زر التسجيل */
.btn-submit {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

/* تذييل النموذج */
.form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    margin-bottom: 8px;
}

.developer-credit {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

/* ============================================
   قسم الرسومات المتحركة (مكيف الهواء)
   ============================================ */

.animation-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.ac-unit-container {
    position: relative;
    width: 350px;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* تنسيق صورة GIF المتحركة */
.ac-gif-image {
    width: 120%;
    height: auto;
    max-height: 550px;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: imageSlideIn 0.8s ease-out;
    filter: brightness(1.15) contrast(1.3) saturate(1.2);
    background: transparent;
    mix-blend-mode: multiply;
}

@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* الوحدة الخارجية */
.outdoor-unit,
.indoor-unit {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.outdoor-unit {
    width: 150px;
    height: 120px;
    animation: vibrate 0.5s infinite;
}

@keyframes vibrate {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(0.5deg); }
    75% { transform: translateY(2px) rotate(-0.5deg); }
}

.indoor-unit {
    width: 200px;
    height: 100px;
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* جسم الوحدة */
.unit-body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.unit-front {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* فتحات الهواء */
.air-vents {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.vent {
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.2));
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.vent::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: windFlow 1.5s infinite;
}

@keyframes windFlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* لوحة التحكم */
.control-panel {
    display: flex;
    gap: 8px;
    align-items: center;
}

.led-light {
    width: 12px;
    height: 12px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 10px #00ff88;
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 20px #00ff88;
        transform: scale(1.1);
    }
}

/* خطوط الأنابيب */
.pipe-line {
    width: 4px;
    height: 80px;
    background: linear-gradient(to right, 
        rgba(255, 100, 100, 0.5), 
        rgba(100, 100, 255, 0.5));
    border-radius: 2px;
    position: relative;
    box-shadow: 0 0 15px rgba(100, 150, 255, 0.5);
    animation: pipeFlow 2s ease-in-out infinite;
}

@keyframes pipeFlow {
    0%, 100% { 
        opacity: 0.5;
        box-shadow: 0 0 15px rgba(100, 150, 255, 0.5);
    }
    50% { 
        opacity: 1;
        box-shadow: 0 0 25px rgba(100, 150, 255, 0.8);
    }
}

/* جزيئات الهواء */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.particle:nth-child(1) {
    left: 20%;
    animation: float-particle 4s ease-in-out infinite;
}

.particle:nth-child(2) {
    left: 30%;
    animation: float-particle 4.5s ease-in-out infinite 0.5s;
}

.particle:nth-child(3) {
    left: 50%;
    animation: float-particle 5s ease-in-out infinite 1s;
}

.particle:nth-child(4) {
    left: 70%;
    animation: float-particle 4.5s ease-in-out infinite 1.5s;
}

.particle:nth-child(5) {
    left: 80%;
    animation: float-particle 5s ease-in-out infinite 0.3s;
}

@keyframes float-particle {
    0% {
        bottom: 0;
        opacity: 0;
        transform: translateX(0) scale(1);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateX(var(--offset, 0px));
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateX(var(--offset, 0px)) scale(0);
    }
}

.particle:nth-child(1) {
    --offset: -30px;
}

.particle:nth-child(2) {
    --offset: -15px;
}

.particle:nth-child(3) {
    --offset: 0px;
}

.particle:nth-child(4) {
    --offset: 15px;
}

.particle:nth-child(5) {
    --offset: 30px;
}

/* النص المعلوماتي */
.info-text {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.info-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 5px 0;
    direction: rtl;
}

.info-text p {
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    direction: rtl;
}

/* ============================================
   التجاوب مع الأجهزة المختلفة
   ============================================ */

@media (max-width: 1024px) {
    .login-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .form-wrapper {
        padding: 40px;
    }

    .animation-section {
        display: none;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 20px;
    }

    .login-content {
        width: 100%;
        max-width: 100%;
        padding: 0;
        gap: 20px;
    }

    .form-wrapper {
        padding: 30px;
        max-width: 100%;
    }

    .form-title {
        font-size: 20px;
    }

    .form-subtitle {
        font-size: 12px;
    }

    .logo-container {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .glass-input {
        font-size: 14px;
        padding: 12px 0;
    }

    .btn-submit {
        padding: 12px 20px;
        font-size: 14px;
    }

    .form-footer {
        margin-top: 20px;
        padding-top: 15px;
    }

    .animation-section {
        display: flex;
    }

    .ac-unit-container {
        width: 100%;
        height: 250px;
    }

    .ac-gif-image {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .gradient-background {
        background: linear-gradient(135deg, 
            #2c1810 0%,
            #4a3728 50%,
            #1e4d7b 100%);
    }

    .login-content {
        grid-template-columns: 1fr;
    }

    .form-wrapper {
        padding: 20px;
        max-width: 100%;
    }

    .form-header {
        margin-bottom: 25px;
    }

    .form-title {
        font-size: 18px;
    }

    .form-subtitle {
        font-size: 11px;
    }

    .logo-container {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin-bottom: 15px;
    }

    .glass-input {
        font-size: 13px;
        padding: 10px 0;
    }

    .input-wrapper {
        padding: 0 12px;
    }

    .input-icon {
        font-size: 14px;
        margin-left: 8px;
    }

    .form-label {
        font-size: 12px;
    }

    .btn-submit {
        padding: 10px 16px;
        font-size: 13px;
        letter-spacing: 0.5px;
    }

    .form-footer {
        margin-top: 15px;
        padding-top: 12px;
    }

    .footer-text {
        font-size: 11px;
    }

    .developer-credit {
        font-size: 10px;
    }

    .animation-section {
        display: flex;
        margin-top: 20px;
    }

    .ac-unit-container {
        width: 100%;
        height: 200px;
    }

    .ac-gif-image {
        max-height: 200px;
    }
}

/* ============================================
   طباعة
   ============================================ */

@media print {
    .login-container {
        background: white;
    }

    .gradient-background {
        display: none;
    }

    .glass-morphism {
        background: white;
        border: 1px solid #ddd;
    }
}