
/* ========================================
   Authentication Overlay - Apple Style
   ======================================== */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 248, 248, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.auth-container {
    /* Glassmorphic card matching login page */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);

    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
        0 0 0 0.5px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 12px 28px rgba(0, 0, 0, 0.06),
        0 24px 48px rgba(0, 0, 0, 0.04);

    padding: 48px;
    border-radius: 20px;
    text-align: center;
    min-width: 400px;
}

.auth-container h1 {
    color: #000000;
    margin-bottom: 12px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.auth-container p {
    color: #666666;
    margin-bottom: 32px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
}

/* ========================================
   User Info Widget - Apple Style
   ======================================== */

.user-info {
    position: fixed;
    top: 20px;
    right: 20px;

    /* Glassmorphic background */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    padding: 6px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
}

/* Compact state styles */
.user-info .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    object-fit: cover;
    transition: all 0.3s ease;
}

.user-info .user-details {
    color: #000000;
    font-size: 14px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.user-info .user-details > div:first-child {
    font-weight: 600;
    white-space: nowrap;
}

.user-info .user-details > div:last-child {
    font-size: 12px;
    color: #666666;
    white-space: nowrap;
}

.user-info .sign-out-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.user-info .sign-out-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
}

/* Expanded state on hover */
.user-info:hover {
    padding: 10px 16px;
    gap: 12px;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.06);
}

.user-info:hover .user-avatar {
    width: 32px;
    height: 32px;
}

.user-info:hover .user-details {
    max-width: 200px;
    opacity: 1;
    margin-right: 8px;
}

.user-info:hover .sign-out-btn {
    font-size: 13px;
    padding: 6px 12px;
}

/* Visual indicator for expandable state */
.user-info::after {
    content: '◀';
    position: absolute;
    left: 10px;
    color: rgba(0, 0, 0, 0.3);
    font-size: 10px;
    transition: transform 0.3s ease;
}

.user-info:hover::after {
    transform: rotate(-180deg);
}

/* Mobile adjustments - Apple Style */
@media (max-width: 768px) {
    .user-info {
        top: 16px;
        right: 16px;
    }

    /* On mobile, make it tap to expand instead of hover */
    .user-info.expanded {
        padding: 10px 16px;
        gap: 12px;
        box-shadow:
            0 4px 16px rgba(0, 0, 0, 0.1),
            0 12px 32px rgba(0, 0, 0, 0.06);
    }

    .user-info.expanded .user-avatar {
        width: 32px;
        height: 32px;
    }

    .user-info.expanded .user-details {
        max-width: 200px;
        opacity: 1;
        margin-right: 8px;
    }

    .user-info.expanded .sign-out-btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    .user-info.expanded::after {
        transform: rotate(-180deg);
    }
}

/* Hide main app initially */
body.authenticating #app-container {
    display: none;
}

body.authenticated #auth-overlay {
    display: none;
}

body.authenticated #app-container {
    display: block;
}

/* ========================================
   Login Page - Apple-Inspired Minimal Design
   ======================================== */

.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    /* Light minimal background matching inference.html */
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Apple system font */
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

/* Apple-style glassmorphic card */
.login-card {
    /* Glassmorphic effect matching main panel */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);

    /* Apple-style border and shadows */
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        /* Inner light edge */
        inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
        /* Outer shadows */
        0 0 0 0.5px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 12px 28px rgba(0, 0, 0, 0.06),
        0 24px 48px rgba(0, 0, 0, 0.04);

    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
}

/* Clean title without gradient */
.login-title {
    font-size: 28px;
    font-weight: 600;
    color: #000000;
    letter-spacing: -0.02em;
    margin: 0 0 8px 0;
}

/* Subtitle with muted color */
.login-subtitle {
    font-size: 15px;
    color: #666666;
    margin: 0 0 32px 0;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Minimal divider */
.login-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 32px 0;
}

/* Message text */
.login-message {
    font-size: 14px;
    color: #000000;
    margin: 0 0 28px 0;
    line-height: 1.6;
    font-weight: 400;
}

#google-signin-container {
    display: flex;
    justify-content: center;
    margin: 28px 0;
    min-height: 48px;
    transition: opacity 0.3s ease;
}

/* Override Google button styles for better integration */
#google-signin-container > div {
    width: 100% !important;
}

.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.login-footer-text {
    font-size: 13px;
    color: #999999;
    margin: 0;
    line-height: 1.6;
}

/* Apple-style error message */
.error-message {
    color: #FF3B30;
    font-size: 14px;
    margin: 16px 0;
    padding: 12px 16px;
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.2);
    border-radius: 10px;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .login-message {
        font-size: 13px;
    }
}

/* Loading state for Google button */
#google-signin-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Apple-style smooth animation for page load */
.login-card {
    animation: fadeInScale 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}