/* Authentication Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 50%, #000000 100%);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.login-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.login-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 80px rgba(255, 255, 255, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.login-overlay.active .login-card {
    transform: scale(1);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff, #888888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.5;
}

.google-signin-btn {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 12px 24px;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    position: relative;
    overflow: hidden;
}

.google-signin-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(66, 133, 244, 0.04);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.google-signin-btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.12);
    border-color: #d2e3fc;
}

.google-signin-btn:hover:before {
    opacity: 1;
}

.google-signin-btn:active {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.google-icon {
    width: 18px;
    height: 18px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHBhdGggZD0iTTE3LjY0IDkuMjA0NTQ1NDVjMC0uNjM5NzI3MjctLjA1NzI3MjcyLS45ODkwOTA5MS0uMTY0NTQ1NDUtMS4zNzI3MjcyN0g5djIuNzMxODE4MThoNC44NDE4MTgxOGMtLjIwNzI3MjcyIDEuMDkzNjM2MzYtLjg0NjM2MzYzIDIuNjIyNzI3MjctMi40MTgxODE4IDMuNTEzNjM2MzZ2Mi44NDU0NTQ1NGgzLjg1OTA5MDljMS44NzI3MjcyNy0xLjcyMjcyNzI3IDIuOTQ3MjcyNzItNC4yMzE4MTgxOCAyLjk0NzI3MjcyLTcuMjE4MTgxODF6IiBmaWxsPSIjNDI4NWY0Ii8+CiAgICA8cGF0aCBkPSJNOSAxOGMyLjcwOTA5MDkxIDAgNC45NzcyNzI3Mi0uODk3NzI3MjcgNi42MzYzNjM2My0yLjQyNzI3MjczbC0zLjg1OTA5MDkx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no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.user-profile {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 8px 16px 8px 8px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-name {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sign-in-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: #757575;
    padding: 0;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 999;
    display: none;
    border: 1px solid #dadce0;
    min-width: 240px;
    font-family: 'Roboto', sans-serif;
}

.sign-in-prompt:hover {
    transform: translate(-50%, -50%) scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Sign-in prompt inherits the main button styles */
.sign-in-prompt .google-signin-btn {
    border-radius: 16px;
    margin-bottom: 0;
    padding: 12px 20px;
}

.auth-info-container {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 998;
    color: rgba(255, 255, 255, 0.8);
    max-width: 400px;
    padding: 0 20px;
}

.auth-info-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(45deg, #4285f4, #34a853, #fbbc05, #ea4335);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
}

.auth-info-subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.login-required {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #f87171;
    padding: 12px 24px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    display: none;
    z-index: 998;
    font-size: 0.9rem;
}

.welcome-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    text-align: center;
    max-width: 600px;
    padding: 0 20px;
}

.welcome-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #dda0dd);
    background-size: 600% 600%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    line-height: 1.6;
}

.app-container {
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.app-container.logged-in {
    display: block;
    opacity: 1;
}

/* Hide form by default until authenticated */
#appBuilderForm {
    display: none;
}

.app-container.logged-in #appBuilderForm {
    display: block !important;
}

/* Hide entire main app content until authenticated */
.app-container:not(.logged-in) .container,
.app-container:not(.logged-in) .glass-card,
.app-container:not(.logged-in) form,
.app-container:not(.logged-in) .info-message {
    display: none;
    visibility: hidden;
}

.app-container.logged-in .container {
    display: block !important;
    visibility: visible !important;
}

.app-container.logged-in .glass-card {
    display: block !important;
    visibility: visible !important;
}
