/* Modern Authentication System */
/* Clean, polished sign-in interface matching site design */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-container {
    width: min(90vw, 420px);
    max-height: 90vh;
    background: var(--secondary-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: visible;
    position: relative;
    margin: 2rem;
}

.auth-overlay.active .auth-container {
    transform: scale(1) translateY(0);
}

/* Auth Header */
.auth-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    background: transparent;
    position: relative;
}

.auth-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.auth-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.auth-logo {
    width: 56px;
    height: 56px;
    background: transparent;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.auth-logo i {
    font-size: 1.5rem;
    color: white;
}

.auth-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.auth-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.01em;
    font-family: 'Poppins', sans-serif;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
    line-height: 1.4;
    font-weight: 400;
}

/* Auth Content */
.auth-content {
    padding: 0 2rem 2rem;
}

.auth-benefits {
    margin-bottom: 1.75rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
}

.benefit-item i {
    color: #4CAF50;
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

/* Google Sign-In Button */
.google-signin-btn {
    width: 100%;
    background: white;
    color: #1f1f1f;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.google-icon-svg {
    display: inline-block;
}

.google-signin-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.google-signin-btn:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

.google-icon {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #4285f4, #34a853, #fbbc05, #ea4335);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 12px;
}

.google-icon::before {
    content: 'G';
}

/* Alternative Sign-In Options */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 400;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

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

.guest-continue-btn {
    width: 100%;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.guest-continue-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Agreements Container */
.auth-agreements {
    margin: 1.5rem 0 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.agreements-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.agreements-header i {
    color: #4CAF50;
    font-size: 1rem;
}

.agreement-item {
    margin-bottom: 0.75rem;
    position: relative;
}

.agreement-item:last-child {
    margin-bottom: 0;
}

.agreement-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.agreement-checkbox {
    display: none;
}

.agreement-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--primary-bg);
    position: relative;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s ease;
}

.agreement-checkbox:checked + .agreement-checkmark {
    background: #4CAF50;
    border-color: #4CAF50;
}

.agreement-checkbox:checked + .agreement-checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.agreement-text {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.4;
}

.agreement-link {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.agreement-link:hover {
    color: #45a049;
    text-decoration: underline;
}

.agreement-checkbox-label:hover .agreement-checkmark {
    border-color: rgba(255, 255, 255, 0.3);
}

.agreement-checkbox:focus + .agreement-checkmark {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Error States */
.agreement-item.error .agreement-checkmark {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.agreement-item.error .agreement-checkbox:checked + .agreement-checkmark {
    background: #4CAF50;
    border-color: #4CAF50;
}

.terms-error,
.privacy-error {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-weight: 500;
    animation: slideInUp 0.3s ease;
}

/* Loading State */
.auth-loading {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.auth-loading.active {
    display: flex;
}

.auth-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .auth-container {
        width: 95vw;
        border-radius: 12px;
        margin: 1rem;
    }

    .auth-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .auth-subtitle {
        font-size: 0.85rem;
    }

    .auth-content {
        padding: 0 1.5rem 1.5rem;
    }

    .google-signin-btn,
    .guest-continue-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .auth-logo {
        width: 48px;
        height: 48px;
        margin-bottom: 1rem;
    }

    .auth-logo i {
        font-size: 1.3rem;
    }
    
    .auth-logo-img {
        border-radius: 10px;
    }
    
    .agreement-checkbox-label {
        font-size: 0.8rem;
        gap: 0.6rem;
    }
    
    .agreement-checkmark {
        width: 16px;
        height: 16px;
    }
    
    .agreement-text {
        font-size: 0.8rem;
    }
    
    .auth-agreements {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        width: 98vw;
        border-radius: 16px;
    }

    .auth-header {
        padding: 1.5rem 1rem 0.75rem;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .auth-content {
        padding: 0 1rem 1.5rem;
    }

    .benefit-item {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-benefits,
.google-signin-btn,
.auth-divider,
.guest-continue-btn,
.auth-agreements {
    animation: slideInUp 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.auth-benefits { animation-delay: 0.1s; }
.google-signin-btn { animation-delay: 0.2s; }
.auth-divider { animation-delay: 0.3s; }
.guest-continue-btn { animation-delay: 0.4s; }
.auth-agreements { animation-delay: 0.5s; }

/* Focus States for Accessibility */
.google-signin-btn:focus,
.guest-continue-btn:focus,
.auth-close-btn:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Success State */
.auth-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-primary);
}

.auth-success.active {
    display: flex;
}

.auth-success i {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 1rem;
}

.auth-success h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-success p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Guest Mode Styles - Identical to signed-in buttons */
.guest-restricted {
    /* No visual differences - buttons look exactly the same */
}

.post-actions.guest-mode {
    /* Keep the same styling as regular post actions */
}

.post-actions.guest-mode .action-buttons {
    display: flex !important;
}