/* User Authentication Styles */

/* Auth Modal Container */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999999;
    display: none;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auth Overlay */
.auth-modal-overlay,
.user-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 10, 20, 0.85), rgba(10, 20, 40, 0.85));
    backdrop-filter: blur(10px);
    z-index: 99999998;
    animation: fadeIn 0.3s ease-out;
}

.user-auth-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999999;
}

.user-auth-overlay.hidden {
    display: none;
}

/* Auth Modal Content */
.auth-modal-content,
.user-auth-modal {
    background: linear-gradient(135deg, rgba(10, 20, 40, 0.98), rgba(20, 30, 50, 0.98));
    border: 3px solid var(--primary-color);
    border-radius: 30px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 100px var(--glow-color);
    animation: slideUp 0.5s ease-out;
    z-index: 99999999;
    position: relative;
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100000000;
}

.auth-modal-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Auth Form Container */
.auth-form {
    width: 100%;
}

.auth-form h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* Google Button */
.google-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.google-btn:hover {
    background: #f8f8f8;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.google-btn img {
    width: 20px;
    height: 20px;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.9rem;
}

/* Form Group */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 149, 255, 0.2);
}

/* Submit Button */
.btn-full {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
}

/* Auth Switch Links */
.auth-switch {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-switch a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.auth-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Auth Form */
.user-auth-form {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.02) 0%, 
        rgba(0, 149, 255, 0.02) 100%);
    border-radius: 24px;
    border: 1px solid rgba(0, 149, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 149, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
}

.user-auth-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 149, 255, 0.3), 
        transparent);
    border-radius: 24px 24px 0 0;
}

.auth-form-group {
    margin-bottom: 2rem;
    position: relative;
}

.auth-form-group label {
    display: block;
    font-size: 0.95rem;
    color: rgba(0, 149, 255, 0.9);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Add icon styling for form fields */
.auth-form-group::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 8px;
    width: 3px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.auth-form-group:focus-within::before {
    opacity: 1;
    height: 24px;
    box-shadow: 0 0 10px rgba(0, 149, 255, 0.5);
}

.auth-form-group input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, 
        rgba(0, 149, 255, 0.08) 0%, 
        rgba(0, 217, 255, 0.05) 100%);
    border: 2px solid rgba(0, 149, 255, 0.2);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 15px rgba(0, 149, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-height: 56px;
    box-sizing: border-box;
}

.auth-form-group input:focus {
    outline: none;
    border-color: rgba(0, 149, 255, 0.6);
    background: linear-gradient(135deg, 
        rgba(0, 149, 255, 0.12) 0%, 
        rgba(0, 217, 255, 0.08) 100%);
    box-shadow: 
        0 0 0 4px rgba(0, 149, 255, 0.15),
        0 8px 30px rgba(0, 149, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.auth-form-group input::placeholder {
    color: rgba(100, 150, 180, 0.7);
    opacity: 1;
    font-weight: 400;
}

/* Enhanced form field styling on hover */
.auth-form-group input:hover {
    border-color: rgba(0, 149, 255, 0.4);
    background: linear-gradient(135deg, 
        rgba(0, 149, 255, 0.10) 0%, 
        rgba(0, 217, 255, 0.06) 100%);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(0, 149, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Add subtle animation for input validation */
.auth-form-group input.valid {
    border-color: rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.08) 0%, 
        rgba(16, 185, 129, 0.05) 100%);
}

.auth-form-group input.invalid {
    border-color: rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.08) 0%, 
        rgba(239, 68, 68, 0.05) 100%);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.auth-error {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 20px;
    text-align: center;
}

.auth-success {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Auth Button */
.auth-btn {
    width: 100%;
    padding: 1.4rem 2rem;
    background: linear-gradient(135deg, 
        rgba(0, 149, 255, 1) 0%, 
        rgba(0, 217, 255, 1) 100%);
    border: 2px solid rgba(0, 149, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 25px rgba(0, 149, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 64px;
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(0, 149, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(0, 149, 255, 0.5);
}

.auth-btn:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 
        0 8px 20px rgba(0, 149, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.auth-btn-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.auth-btn:hover .auth-btn-icon {
    transform: translateX(5px);
}

/* Social Auth Buttons */
.social-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-auth-btn {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.social-auth-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.social-auth-btn.google {
    border-color: #4285f4;
}

.social-auth-btn.google:hover {
    border-color: #4285f4;
    box-shadow: 0 5px 20px rgba(66, 133, 244, 0.3);
}

.social-auth-btn.facebook {
    border-color: #1877f2;
}

.social-auth-btn.facebook:hover {
    border-color: #1877f2;
    box-shadow: 0 5px 20px rgba(24, 119, 242, 0.3);
}

.social-icon {
       width: 20px;
       height: 20px;
       display: flex;
       align-items: center;
       justify-content: center;
   }
   
   .social-icon svg {
       width: 100%;
       height: 100%;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Auth Toggle */
.auth-toggle {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 217, 255, 0.2);
}

.auth-toggle p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.auth-toggle-link {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.auth-toggle-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* User Dashboard Panel */
.user-dashboard-panel {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(123, 47, 247, 0.1));
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
}

.user-welcome {
    text-align: center;
    margin-bottom: 2rem;
}

.user-welcome h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-welcome p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.user-stat-card {
    background: rgba(0, 217, 255, 0.05);
    border: 2px solid rgba(0, 217, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.user-stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.user-stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.user-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.user-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.user-action-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.user-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--primary-color);
}

.user-action-btn.secondary {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.user-action-btn.secondary:hover {
    background: rgba(0, 217, 255, 0.1);
}

/* User Menu */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 217, 255, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-trigger:hover {
    background: rgba(0, 217, 255, 0.2);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.3);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

/* Mobile avatar size - larger for easier tapping */
@media (max-width: 480px) {
    .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: rgba(10, 20, 40, 0.98);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
}

.user-menu-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-item {
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item:hover {
    background: rgba(0, 217, 255, 0.1);
    color: var(--primary-color);
}

.user-menu-item.logout {
    color: var(--danger-color);
}

.user-menu-item.logout:hover {
    background: rgba(255, 0, 85, 0.1);
}

/* Auth Buttons in Navigation */
.btn-login,
.btn-signup {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-left: 0.5rem;
}

.btn-login {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-login:hover {
    background: rgba(0, 217, 255, 0.1);
    transform: translateY(-2px);
}

.btn-signup {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--primary-color);
}

/* Hide auth buttons when user is logged in */
body.authenticated #authButtons {
    display: none;
}

/* Responsive Design */
@media (max-width: 480px) {
    .user-auth-modal {
        padding: 0.5rem !important;
        max-width: 92% !important;
        width: 92% !important;
        border-radius: 12px !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        margin-top: 0 !important;
    }

    .auth-header {
        margin-bottom: 0.4rem !important;
    }

    .auth-logo {
        font-size: 1rem !important;
        margin-bottom: 0.15rem !important;
    }

    .auth-title {
        font-size: 0.85rem !important;
        margin-bottom: 0.15rem !important;
    }

    .auth-subtitle {
        display: none !important;
    }

    .user-auth-form {
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .social-auth-buttons {
        margin-bottom: 0.4rem !important;
        gap: 0.3rem !important;
    }

    .social-auth-btn {
        font-size: 0.7rem !important;
        padding: 0.45rem 0.6rem !important;
        min-height: auto !important;
    }

    .social-icon {
        font-size: 0.8rem !important;
        margin-right: 0.25rem !important;
    }

    .auth-form-group {
        margin-bottom: 0.4rem !important;
    }

    .auth-form-group label {
        font-size: 0.7rem !important;
        margin-bottom: 0.15rem !important;
    }

    .auth-form-group input {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
        min-height: auto !important;
    }

    .auth-submit-btn {
        padding: 0.55rem !important;
        font-size: 0.8rem !important;
        margin-top: 0.4rem !important;
    }

    .auth-divider {
        margin: 0.5rem 0 !important;
        font-size: 0.7rem !important;
    }

    .auth-footer {
        margin-top: 0.75rem !important;
        font-size: 0.7rem !important;
    }

    .auth-footer a {
        font-size: 0.7rem !important;
    }

    .close-modal {
        top: 0.4rem !important;
        right: 0.4rem !important;
        font-size: 1.3rem !important;
        width: 28px !important;
        height: 28px !important;
    }

    .forgot-password {
        font-size: 0.65rem !important;
        margin-top: 0.3rem !important;
    }

    .auth-form-group input {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .auth-submit-btn {
        padding: 0.7rem;
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }

    .auth-divider {
        margin: 0.75rem 0;
        font-size: 0.75rem;
    }

    .form-extra {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .auth-footer {
        font-size: 0.75rem;
        margin-top: 0.75rem;
    }

    .auth-close-btn {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .user-dashboard-panel {
        padding: 1.5rem;
    }

    .user-welcome h2 {
        font-size: 1.6rem;
    }

    .user-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .user-actions {
        flex-direction: column;
    }

    .user-action-btn {
        width: 100%;
    }
    
    .btn-login,
    .btn-signup {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin-left: 0.3rem;
    }
}
/* Mobile Google Sign-In Styles */
.mobile-google-signin {
    display: none;
    margin-bottom: 1rem;
}

.desktop-google-btn {
    display: flex;
}

/* Show mobile button on mobile devices, hide desktop button */
@media (max-width: 480px) {
    .mobile-google-signin {
        display: block;
    }
    
    .desktop-google-btn {
        display: none;
    }
}

/* Ensure Google button renders properly */
.mobile-google-signin > div {
    width: 100% !important;
}
