html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Reset default styles for all pages */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* General body styles for Login and Registration Pages */
body {
    font-family: 'Tajawal', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(270deg, #051d40, #0c3c85, #1f5fa0, #0c3c85, #051d40);
    background-size: 600% 600%;
    animation: gradientFlow 20s ease-in-out infinite;
    overflow-x: hidden;
    position: relative;
}


/* Gradient animation for body background (Login and Registration Pages) */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Navbar styles for all pages */
.navbar {
    position: sticky;
    top: 0;
    padding: 0.4rem 2rem;
    z-index: 100;
    opacity: 0.95;
    background: linear-gradient(135deg, #162e67, #27478d, #3b60b4, #27478d, #162e67);
    background-size: 400% 400%;
    animation: navbarGradient 15s ease infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Navbar gradient animation for all pages */
@keyframes navbarGradient {
    0% {
        background-position: 100% 100%;
    }

    50% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

/* Navbar logo styles for all pages */
.navbar-brand img {
    height: 40px;
}

/* Container for auth form and image (Login and Registration Pages) */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    padding: 0.5px;
}

/* Auth form styles (Login and Registration Pages) */
.auth-form {
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    max-width: 50%;
    margin: auto;
}

    /* Icons inside form inputs (Login and Registration Pages) */
    .auth-form i {
        position: absolute;
        top: 35%;
        left: 25px;
        transform: translateY(-50%);
        z-index: 5;
        font-size: 1.5rem;
        color: black;
    }

    /* Border animation for auth form (Login and Registration Pages) */
    .auth-form::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 2px solid transparent;
        border-radius: 12px;
        background-size: 400% 400%;
        animation: borderAnim 10s linear infinite;
        z-index: 1;
        pointer-events: none;
    }

    /* Ensure form content is above border animation (Login and Registration Pages) */
    .auth-form * {
        position: relative;
        z-index: 2;
    }

/* Border animation keyframes (Login and Registration Pages) */
@keyframes borderAnim {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

i.bi-phone {
    left: 60px;
}
/* Form input styles (Login and Registration Pages) */
.form-control {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

    /* Form input focus styles (Login and Registration Pages) */
    .form-control:focus {
        box-shadow: 0 0 5px 2px #42a5f6;
    }

/* Auth links below form (Login Page) */
.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

    /* Auth links styling (Login Page) */
    .auth-links a {
        color: #ffffff;
        text-decoration: underline;
    }

/* Background image for Login Page */
.login-auth-image {
    position: relative;
    flex: 1;
    top: 1px;
    margin-right: 40px;
    height: 73.8vh;
    background: url("/images/Login Background.jpg") no-repeat center center / cover;
    opacity: 0;
    animation: fadeIn 3s ease-in-out forwards;
}

/* Background image for Registration Page */
.signup-auth-image {
    position: relative;
    flex: 1;
    margin-right: 40px;
    background: url("/images/Login Background.jpg") no-repeat center center / cover;
    opacity: 0;
    animation: fadeIn 3s ease-in-out forwards;
}

/* Fade-in animation for background images (Login and Registration Pages) */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Animated borders for background images (Login and Registration Pages) */
.login-auth-image::after,
.login-auth-image::before,
.signup-auth-image::after,
.signup-auth-image::before {
    content: "";
    position: absolute;
    background: linear-gradient(to bottom, #ffd700, #ffeb3b, transparent);
    width: 5px;
    height: 0;
    border-radius: 25px;
    opacity: 0;
    animation: lineGrowFade 4s ease-in-out infinite alternate;
}

/* Right border for background images (Login and Registration Pages) */
.login-auth-image::after,
.signup-auth-image::after {
    top: 0;
    right: -0.5px;
}

/* Left border for background images (Login and Registration Pages) */
.login-auth-image::before,
.signup-auth-image::before {
    bottom: 0;
    left: -0.5px;
}

/* Border animation keyframes (Login and Registration Pages) */
@keyframes lineGrowFade {
    0% {
        height: 0;
        opacity: 0;
        background: linear-gradient(to bottom, #ffd700, #ffeb3b);
    }

    10% {
        height: 10%;
        opacity: 0.3;
        background: linear-gradient(to bottom, #ffe600, #fff176);
    }

    25% {
        height: 25%;
        opacity: 0.5;
        background: linear-gradient(to bottom, #fff34d, #fff9c4);
    }

    50% {
        height: 50%;
        opacity: 0.7;
        background: linear-gradient(to bottom, #fff176, #fffde7);
    }

    75% {
        height: 75%;
        opacity: 0.5;
        background: linear-gradient(to bottom, #fffde7, #fffff0);
    }

    90% {
        height: 90%;
        opacity: 0.3;
        background: linear-gradient(to bottom, #fffff0, #ffffff);
    }

    100% {
        height: 100%;
        opacity: 0;
        background: linear-gradient(to bottom);
    }
}

/* Overlay for background images (Login and Registration Pages) */
.overlay {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    left: 0;
    background: linear-gradient(45deg, rgba(100, 99, 99, 0.15), rgba(0, 0, 0, 0.1));
    z-index: 1;
}

/* Footer styles for all pages */
footer {
    background-color: #212121;
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    /* Footer social media section (all pages) */
    footer > div {
        margin: 0 68px 0 0;
    }

        /* Footer social media heading (all pages) */
        footer > div > h3 {
            color: #95f2b4;
        }

/* Social media icon hover effects (all pages) */
.instagram:hover {
    color: #E1306C !important;
}

.twitter:hover {
    color: #1DA1F2 !important;
}

.youtube:hover {
    color: #FF0000 !important;
}

.facebook:hover {
    color: #1877F2 !important;
}

/* Social media icon animations (all pages) */
@keyframes glowInstagram {
    0%, 100% {
        color: white;
    }

    12.5% {
        color: #E1306C;
    }

    25% {
        color: white;
    }
}

@keyframes glowTwitter {
    0%, 25% {
        color: white;
    }

    37.5% {
        color: #7b957c;
    }

    50% {
        color: white;
    }
}

@keyframes glowYouTube {
    0%, 50% {
        color: white;
    }

    62.5% {
        color: #FF0000;
    }

    75% {
        color: white;
    }
}

@keyframes glowFacebook {
    0%, 75% {
        color: white;
    }

    87.5% {
        color: #1877F2;
    }

    100% {
        color: white;
    }
}

.social-icon {
    color: white;
    transition: color 0.3s ease;
}

.social-animation .instagram {
    animation: glowInstagram 8s infinite ease-in-out;
}

.social-animation .twitter {
    animation: glowTwitter 8s infinite ease-in-out;
}

.social-animation .youtube {
    animation: glowYouTube 8s infinite ease-in-out;
}

.social-animation .facebook {
    animation: glowFacebook 8s infinite ease-in-out;
}

/* Footer logo (all pages) */
footer img {
    height: 24px;
}

/* Phone input styles (Registration Page) */
.phone-selection {
    height: 48px;
    background: #d1dff0;
    cursor: not-allowed;
}

/* Phone code dropdown styles (Registration Page) */
.no-arrow {
    appearance: none;
    width: 50px;
}

/* Disabled input styles (Registration Page) */
:disabled {
    opacity: 0.5;
    color: #fc00006f;
    cursor: not-allowed;
}

/* Responsive Design for Login and Registration Pages */


/* Hero Section for Role Selection Page */
.hero-section {
    flex: 1;
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
}

/* Container for hero section (Role Selection Page) */
.hero-section .container {
    max-width: 1200px;
}

/* Main heading for hero section (Role Selection Page) */
.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    animation: fadeIn 1s ease-in-out;
}

/* Lead text for hero section (Role Selection Page) */
.hero-section .lead {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Role selection cards (Role Selection Page) */
.role-card {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect for role cards (Role Selection Page) */
.role-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

/* Icons for role cards (Role Selection Page) */
.role-icon {
    font-size: 3rem;
    color: #00d2ff;
    margin-bottom: 1rem;
    display: block;
}

/* Card title for role selection (Role Selection Page) */
.card-title {
    font-size: 1.75rem;
    color: #ffffff;
    margin-bottom: 1rem;
}

/* Card text for role description (Role Selection Page) */
.card-text {
    font-size: 1rem;
    color: #e0e0e0;
    margin-bottom: 1.5rem;
}

/* Button styles for role selection (Role Selection Page) */
.btn-role {
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Hover effect for role buttons (Role Selection Page) */
.btn-role:hover {
    transform: scale(1.05);
}

/* Primary button styles (Role Selection Page) */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

/* Success button styles (Role Selection Page) */
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

/* Fade-in animation for hero section (Role Selection Page) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        background: url("/images/Login Background.jpg") no-repeat center center fixed;
        background-size: cover;
        animation: none;
    }

    .login-auth-image {
        display: none;
    }
}
/* Responsive Navbar */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
    }

        .navbar .btn {
            margin-bottom: 0.5rem;
            width: 100%;
            text-align: center;
        }

    .navbar-brand {
        justify-content: center;
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Responsive Footer */
@media (max-width: 768px) {
    footer {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

        footer > div {
            margin: 0;
        }

        footer img {
            margin-top: 1rem;
        }
}

@media (max-width: 768px) {
    .auth-form {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
        align-items: center;
    }

    .signup-auth-image {
        display: none; 
    }

    .auth-form {
        max-width: 100%;
        padding: 20px;
    }

        .auth-form .row > div {
            margin-bottom: 15px;
        }
}

/* Math overlay for floating numbers (Home Page) */
.math-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

    /* Floating numbers animation (Home Page) */
    .math-overlay span {
        position: absolute;
        font-size: 2.7rem;
        font-weight: bold;
        opacity: 0;
        animation: floatDown 4s ease-in-out infinite, colorShift 3s ease-in-out infinite;
        user-select: none;
        white-space: nowrap;
    }

/* Float down animation for numbers (Home Page) */
@keyframes floatDown {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    80% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(40px);
        opacity: 0;
    }
}

/* Color shift animation for numbers (Home Page) */
@keyframes colorShift {
    0% {
        color: rgba(0, 160, 255, 0.25);
        text-shadow: 0 0 5px rgba(0, 160, 255, 0.2);
    }

    50% {
        color: rgba(100, 200, 255, 0.25);
        text-shadow: 0 0 8px rgba(100, 200, 255, 0.3);
    }

    100% {
        color: rgba(0, 160, 255, 0.25);
        text-shadow: 0 0 5px rgba(0, 160, 255, 0.2);
    }
}
