/**
 * Authentication UI Styles
 * Styles for login screen, loading states, and error messages
 */

/* Utility class for hidden elements */
.hidden {
    display: none !important;
}

/* Auth Container - Login Screen */
#auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

[data-theme="dark"] .auth-card {
    background: #2d2d2d;
    color: #e0e0e0;
}

.auth-card h1 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.8rem;
}

[data-theme="dark"] .auth-card h1 {
    color: #e0e0e0;
}

.auth-card p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

[data-theme="dark"] .auth-card p {
    color: #b0b0b0;
}

.auth-card .app-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Sign In Button */
.sign-in-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.sign-in-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.sign-in-button:active {
    transform: translateY(0);
}

/* Unauthorized Container */
#unauthorized-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    z-index: 10000;
}

.unauthorized-card {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

[data-theme="dark"] .unauthorized-card {
    background: #2d2d2d;
    color: #e0e0e0;
}

.unauthorized-card h1 {
    margin: 0 0 1rem 0;
    color: #d32f2f;
    font-size: 1.8rem;
}

[data-theme="dark"] .unauthorized-card h1 {
    color: #ff6b6b;
}

.unauthorized-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

[data-theme="dark"] .unauthorized-card p {
    color: #b0b0b0;
}

.unauthorized-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.sign-out-button {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sign-out-button:hover {
    background: #b71c1c;
    transform: translateY(-2px);
}

/* Loading Container */
#loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

.loading-content p {
    font-size: 1.1rem;
    margin: 0;
}

/* Error Container */
#error-container {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: #d32f2f;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    animation: slideInRight 0.3s ease-out;
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-text {
    flex: 1;
}

.error-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.error-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.95;
}

.error-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.error-close:hover {
    opacity: 1;
}

/* User Info Display - Minimal Button Style */
#user-info {
    background: var(--color-bg, #ffffff);
    border: 1px solid var(--color-border, #e0e0e0);
    color: var(--color-text, #333);
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    position: relative;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

#user-info:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

[data-theme="dark"] #user-info {
    background: var(--color-bg, #1a1a1a);
    border-color: var(--color-border, #404040);
    color: var(--color-text, #e0e0e0);
}

#user-info .user-avatar {
    display: contents;
}

#user-info .user-name {
    display: none;
}

#user-info .user-sign-out {
    display: none;
}

/* Tooltip on hover */
#user-info::after {
    content: attr(data-user-name);
    position: absolute;
    bottom: -35px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10002;
}

#user-info:hover::after {
    opacity: 1;
}

[data-theme="dark"] #user-info::after {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
}

/* Sign Out Confirmation Modal */
#signout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10003;
    backdrop-filter: blur(4px);
}

.signout-modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.3s ease-out;
}

[data-theme="dark"] .signout-modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

.signout-modal-content h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.3rem;
}

[data-theme="dark"] .signout-modal-content h3 {
    color: #e0e0e0;
}

.signout-modal-content p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

[data-theme="dark"] .signout-modal-content p {
    color: #b0b0b0;
}

.signout-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.signout-modal-button {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.signout-modal-button.cancel {
    background: #e0e0e0;
    color: #333;
}

.signout-modal-button.cancel:hover {
    background: #d0d0d0;
}

[data-theme="dark"] .signout-modal-button.cancel {
    background: #404040;
    color: #e0e0e0;
}

[data-theme="dark"] .signout-modal-button.cancel:hover {
    background: #4a4a4a;
}

.signout-modal-button.confirm {
    background: #d32f2f;
    color: white;
}

.signout-modal-button.confirm:hover {
    background: #b71c1c;
    transform: translateY(-1px);
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-card,
    .unauthorized-card {
        margin: 1rem;
        padding: 2rem;
    }
    
    #error-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    #user-info {
        width: 36px;
        height: 36px;
        font-size: 0.7rem;
    }
}
