﻿/* Base Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.cairo {
    font-family: "cairo", Times, serif;
}

/* Container and Layout */
.login-container {
    min-height: 100vh;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 60px;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    margin-bottom: 70px;
    min-height: calc(100vh - 60px);
}

/* Background and Glass Effect */
.background-radial-gradient {
    background-color: hsl(218, 81%, 85%);
    background-image: radial-gradient(
        650px circle at 0% 0%,
        hsl(218, 41%, 45%) 15%,
        hsl(218, 81%, 75%) 35%,
        hsl(218, 41%, 45%) 75%,
        hsla(0, 0%, 100%, 0.9) 80%,
        transparent 100%
    ),
    radial-gradient(
        1250px circle at 100% 100%,
        hsl(218, 41%, 45%) 15%,
        hsl(218, 41%, 30%) 35%,
        hsl(218, 41%, 20%) 75%,
        hsl(218, 81%, 75%) 80%,
        transparent 90%
    );
}

.bg-glass {
    background-color: hsla(0, 0%, 100%, 0.9) !important;
    backdrop-filter: saturate(200%) blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

/* Logo Styling */
.logo-container {
    padding: 1rem;
}

.logo-img {
    max-height: 120px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Form Controls */
.form-floating > .form-control {
    text-align: right;
    direction: rtl;
    padding-left: 40px !important;
    padding-right: 16px !important;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.form-floating > .form-control:focus {
    border-color: #4f70b5;
    box-shadow: 0 0 0 0.2rem rgba(79, 112, 181, 0.15);
}

/* RTL Form Controls */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0);
    right: 1rem;
    left: auto;
}

.form-floating > label {
    right: 1rem;
    left: auto;
    transform-origin: right top;
}

.rtl-direction {
    direction: rtl;
    text-align: right;
}

/* Password Input and Eye Icon */
.form-floating.form-group-spacing {
    position: relative;
    direction: ltr;
}

.form-floating.form-group-spacing input {
    direction: rtl;
}

.form-floating .btn-link {
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: 100%;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    z-index: 5;
    margin: 0 !important;
    padding: 0 !important;
    color: #4f70b5 !important;
    transition: all 0.3s ease;
}

.form-floating .btn-link:hover {
    color: #779be7 !important;
}

.form-floating .btn-link i {
    font-size: 1.2rem;
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(45deg, #4f70b5, #779be7);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #5a7bc0, #84a5f0);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 112, 181, 0.2);
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to right, #4f70b5, #779be7) !important;
    padding: 0.8rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

footer .footer-text {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

footer .copyright-symbol {
    margin: 0 0.5rem;
    font-size: 1.2rem;
    vertical-align: middle;
}

footer .year {
    font-weight: bold;
    color: #ffffff;
}

/* Welcome Title */
.welcome-title {
    color: #4f70b5;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

/* Spacing */
.form-group-spacing {
    margin-bottom: 1.5rem;
}

.card-body {
    padding: 2.5rem !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .logo-img {
        max-height: 80px;
    }
}

@media (max-height: 700px) {
    .logo-img {
        max-height: 60px;
    }

    .card-body {
        padding: 1.5rem !important;
    }

    .mb-5 {
        margin-bottom: 1.5rem !important;
    }

    .form-group-spacing {
        margin-bottom: 1rem;
    }
}

@media (max-height: 500px) {
    .login-container {
        height: auto;
        min-height: 100%;
    }

    .main-content {
        padding: 1rem 0;
    }
}

@media (max-width: 576px) {
    footer {
        font-size: 0.9rem;
        padding: 0.8rem !important;
    }

    footer .copyright-symbol {
        margin: 0 0.3rem;
        font-size: 1rem;
    }
}

/* iOS Safari Fix */
@supports (-webkit-touch-callout: none) {
    .login-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
