/* Authentication styles */

/* Login Modal */
.login-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 400px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.login-modal.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.login-header {
    padding: 1rem 1.5rem;
    background-color: #34495e;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.login-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.login-form {
    padding: 1.5rem;
}

.login-form .form-field {
    margin-bottom: 1.2rem;
}

.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #2c3e50;
}

.login-form input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.login-message {
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1.2rem;
    text-align: center;
    font-weight: 500;
}

.login-message.error {
    background-color: rgba(231, 76, 60, 0.2);
    color: #c0392b;
    border: 1px solid #e74c3c;
}

.login-message.success {
    background-color: rgba(46, 204, 113, 0.2);
    color: #27ae60;
    border: 1px solid #2ecc71;
}

.login-actions {
    display: flex;
    justify-content: center;
}

.login-button {
    padding: 0.8rem 2rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.login-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.login-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.demo-credentials {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.demo-credentials p {
    margin: 0.3rem 0;
}

/* Auth UI Elements */
.auth-user-display {
    display: flex;
    align-items: center;
    color: white;
    font-weight: 500;
    margin-right: 1rem;
}

.auth-user-display .user-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.auth-buttons {
    display: flex;
    gap: 0.8rem;
}

#login-button,
#logout-button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
}

#login-button {
    background-color: #3498db;
    color: white;
}

#login-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

#logout-button {
    background-color: #95a5a6;
    color: white;
}

#logout-button:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}

/* Auth-required elements */
[data-auth-required] {
    display: none;
    /* Hidden by default, shown when authenticated */
}

/* Unauthorized overlay for auth-required features */
.unauthorized-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(52, 73, 94, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    z-index: 900;
    text-align: center;
    padding: 2rem;
}

.unauthorized-overlay h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.unauthorized-overlay p {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    max-width: 500px;
}

.unauthorized-overlay button {
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.unauthorized-overlay button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}