/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #1a1a2e; /* Dark base for the gradient */
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%);
    animation: moveGradient 25s ease-in-out infinite;
    z-index: -1;
}

@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}



/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.6s ease-in-out;
}

.loading-container {
    text-align: center;
    color: white;
}

.loader {
    margin-bottom: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.brand-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.brand-text p {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
    animation: pulse 2s ease-in-out infinite 0.5s;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Login Screen Styles */
.login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
}

.login-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: fadeIn 0.8s ease-out forwards;
}

.login-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 80px;
    height: 80px; 
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.logo-icon {
    font-size: 2rem;
    color: white;
}

.logo-section h2 {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.logo-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 400;
}

/* Google Login Button */
.google-login-btn {
    width: 100%;
    background: white;
    color: #333;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.google-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.google-login-btn:active {
    transform: translateY(0);
}

.google-icon {
    flex-shrink: 0;
}

/* Divider */
.divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.divider span {
    background: #2e2e4d; /* Match the card's inner feel */
    color: rgba(255, 255, 255, 0.8);
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Email Form */
.email-form {
    margin-bottom: 1.5rem;
}

.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-group label {
    position: absolute;
    top: 1rem;
    left: 3rem; /* Align with text, past the icon */
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem 1rem 1rem 3rem; /* Keep padding for icon */
    font-size: 1rem;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.input-group input:focus {
    outline: none;
    border-color: rgba(192, 132, 252, 0.8);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.2);
}

/* Floating label animation */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -0.7rem;
    left: 0.75rem;
    font-size: 0.8rem;
    color: #c084fc;
    background-color: #252541; /* Slightly lighter than card background for visibility */
    padding: 0 0.3rem;
    border-radius: 4px;
}

.input-icon {
    position: absolute; 
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.7;
}

/* Login Button */
.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #c084fc, #9333ea);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(192, 132, 252, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(192, 132, 252, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    transition: opacity 0.3s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Login Options */
.login-options {
    text-align: center;
}

.login-options a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 0.5rem;
}

.login-options a:hover {
    color: white;
}

/* Profile Screen Styles */
.profile-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.profile-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.profile-container {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.profile-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.profile-header {
    margin-bottom: 2rem;
}

.profile-photo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.profile-placeholder span {
    font-size: 3rem;
    font-weight: 700;
    color: rgb(241, 227, 227);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.profile-header h2 {
    color: rgb(122, 0, 112);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.profile-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 400;
}

.profile-actions {
    margin-top: 2rem;
}

.logout-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
}

.logout-icon {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-screen,
    .profile-screen {
        padding: 1rem;
    }
    
    .login-card,
    .profile-card {
        padding: 2rem;
    }
    
    .brand-text h1 {
        font-size: 2rem;
    }
    
    .logo-section h2 {
        font-size: 1.5rem;
    }
    
    .profile-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-card,
    .profile-card {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .brand-text h1 {
        font-size: 1.8rem;
    }
    
    .brand-text p {
        font-size: 1rem;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .profile-photo {
        width: 100px;
        height: 100px;
    }
    
    .profile-placeholder span {
        font-size: 2.5rem;
    }
}

/* Error Message Styles */
.error-message {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #df3a3a;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.success-message {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: rgb(76, 130, 175);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Profile Circle & Dropdown Styles */
#profile-circle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    z-index: 999;
}

#profile-circle:hover {
    transform: scale(1.1);
}

#profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#profile-initials-circle {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

#profile-dropdown {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 220px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 998;
    text-align: center;
}

#profile-dropdown .profile-header h2 {
    color: #20B2AA; /* Sea Blue */
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    word-wrap: break-word;
}

#profile-dropdown .logout-btn {
    width: 100%;
    margin: 0;
}
