@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: url('https://images.unsplash.com/photo-1497215728101-856f4ea42174?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    height: 100vh;
    margin: 0;
    position: relative;
}

/* Dark overlay for better readability */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* dark transparent overlay */
    z-index: -1;
}

h1 {
    font-weight: 600;
    margin: 0 0 10px;
    color: #fff;
}

span {
    font-size: 12px;
    color: #ddd;
}

p {
    font-size: 14px;
    font-weight: 300;
    line-height: 20px;
    letter-spacing: 0.5px;
    margin: 20px 0 30px;
    color: #eee;
}

a {
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    margin: 15px 0;
    transition: color 0.3s;
}

a:hover {
    color: #ff4b2b;
}

button {
    border-radius: 20px;
    border: 1px solid #ff4b2b;
    background-color: #ff4b2b;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in, box-shadow 0.3s ease;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    box-shadow: 0 0 15px rgba(255, 75, 43, 0.6);
}

button:active {
    transform: scale(0.95);
}

button:focus {
    outline: none;
}

button.ghost {
    background-color: transparent;
    border-color: #FFFFFF;
}

button.ghost:hover {
    background-color: #fff;
    color: #ff4b2b;
}

form {
    /* Glassmorphism setup */
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    text-align: center;
}

input {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
}

input::placeholder {
    color: #ddd;
}

input:focus {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: #ff4b2b;
    box-shadow: 0 0 8px rgba(255, 75, 43, 0.4);
}

.container {
    background: rgba(255, 255, 255, 0.05); /* very light background for container */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    width: 768px;
    max-width: 100%;
    min-height: 480px;
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
}

.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}

@keyframes show {
    0%, 49.99% {
        opacity: 0;
        z-index: 1;
    }
    50%, 100% {
        opacity: 1;
        z-index: 5;
    }
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.container.right-panel-active .overlay-container{
    transform: translateX(-100%);
}

.overlay {
    background: #ff416c;
    background: -webkit-linear-gradient(to right, #ff4b2b, #ff416c);
    background: linear-gradient(to right, #ff4b2b, #ff416c);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
    box-shadow: 0px 0px 20px rgba(255, 75, 43, 0.5);
}

.container.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.overlay-left {
    transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0);
}

.overlay-right {
    right: 0;
    transform: translateX(0);
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}

.social-container {
    margin: 20px 0;
}

.social-container a {
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    height: 40px;
    width: 40px;
    background: rgba(255,255,255,0.1);
}

.social-container a:hover {
    background: #ff4b2b;
    border-color: #ff4b2b;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.mobile-toggle {
    display: none;
    margin-top: 20px;
    font-weight: bold;
    text-decoration: underline;
}

/* Responsive Fix for Small Screens */
@media (max-width: 768px) {
    .container {
        min-height: 550px;
        width: 90%;
    }
    
    .overlay-container {
        display: none; /* Hide the red sliding panel on mobile */
    }
    
    /* Make forms full width */
    .sign-in-container, .sign-up-container {
        width: 100%;
        left: 0;
        transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    }

    /* Default state: Sign In shown, Sign Up hidden */
    .sign-in-container {
        opacity: 1;
        z-index: 2;
        transform: translateX(0);
    }
    .sign-up-container {
        opacity: 0;
        z-index: 1;
        transform: translateX(-100%);
    }

    /* Toggled state: Sign Up shown, Sign In hidden */
    .container.right-panel-active .sign-in-container {
        opacity: 0;
        z-index: 1;
        transform: translateX(100%);
    }
    .container.right-panel-active .sign-up-container {
        opacity: 1;
        z-index: 5;
        transform: translateX(0);
        animation: none; /* Disable desktop animation */
    }

    .mobile-toggle {
        display: block; /* Show the mobile links */
    }

    form {
        padding: 0 20px;
    }
    h1 {
        font-size: 1.5rem;
    }
    p {
        font-size: 12px;
        margin: 15px 0 20px;
    }
    button {
        padding: 10px 30px;
    }
}

/* Mobile Responsiveness Enhancements */
@media (max-width: 768px) {
    .container, .dashboard-container, .main-content { width: 100%; padding: 10px; margin: 0; box-sizing: border-box; }
    .sidebar { width: 100%; position: relative; height: auto; }
    .contacts-grid, .gallery-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .form-group input, .form-group select, .btn { width: 100%; box-sizing: border-box; }
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; }
    tr { border: 1px solid #ccc; margin-bottom: 10px; }
    td { border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50%; text-align: right; }
    td:before { position: absolute; top: 6px; left: 6px; width: 45%; padding-right: 10px; white-space: nowrap; text-align: left; font-weight: bold; content: attr(data-label); }
}

