/**
 * AdWizards Authentication UI Styles
 */

/* ===== Auth Buttons in Navbar ===== */
.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

#auth-login-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#auth-login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

#auth-logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    padding: 6px 12px;
}

#auth-logout-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff6b6b;
}

/* ===== User Info Display ===== */
#auth-user-info {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

#auth-user-email {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Auth Container in Navbar ===== */
.auth-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

/* ===== Loading State ===== */
.auth-loading {
    opacity: 0.5;
    pointer-events: none;
}

.auth-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .auth-container {
        margin-left: 8px;
    }

    #auth-user-email {
        display: none;
    }

    #auth-login-btn {
        padding: 8px 12px;
    }

    #auth-login-btn .auth-btn-text {
        display: none;
    }

    #auth-login-btn .auth-btn-icon {
        display: block;
    }
}

@media (min-width: 769px) {
    #auth-login-btn .auth-btn-icon {
        display: none;
    }
}

/* ===== Auth Required Indicator on Plan Buttons ===== */
[data-checkout-plan]::after {
    content: none;
}

/* Show lock icon when not authenticated */
body:not(.authenticated) [data-checkout-plan]:not([data-checkout-plan="enterprise"])::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
    vertical-align: middle;
}

/* Authenticated state - add class via JS */
body.authenticated [data-checkout-plan]::before {
    display: none;
}