/* Authentication styles for Monumentario */

/* Auth container in header */
.auth-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Update header layout to accommodate auth container */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Auth buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-btn {
    padding: 0.6rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.auth-btn.login-btn {
    background: #ffffff;
    color: #6056e5; /* close to #667eea but higher contrast on white */
    border-color: #ffffff;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3), 0 2px 10px rgba(0,0,0,0.08);
    width: 170px;
}

.auth-btn.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(255, 255, 255, 0.35), 0 4px 14px rgba(0,0,0,0.12);
}

.auth-btn.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25), 0 2px 10px rgba(0,0,0,0.1);
}

.auth-btn.login-btn .login-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}

.auth-btn.register-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-btn.register-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* User menu */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.user-menu-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.user-menu-toggle:hover::before {
    left: 100%;
}

.user-menu-toggle:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.user-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.user-menu-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.profile-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.user-name {
    font-size: 0.9rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.user-dropdown-header strong {
    display: block;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.user-dropdown-header small {
    color: #666;
    font-size: 0.8rem;
}

.user-dropdown hr {
    margin: 0;
    border: none;
    border-bottom: 1px solid #e1e5e9;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-dropdown-item:hover {
    background-color: #f8f9fa;
}

.user-dropdown-item.logout-btn {
    color: #dc3545;
    border-top: 1px solid #e1e5e9;
}

.user-dropdown-item.logout-btn:hover {
    background-color: #f8f9fa;
}

/* Auth pages layout */
body.auth-page .container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Auth pages main layout */
.auth-main {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Different naming for auth page container vs header auth container */
.auth-main .auth-container {
    width: 100%;
    max-width: 400px;
    margin-left: 0;
    margin-right: 0;
}

.auth-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-form input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.auth-form small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.auth-form .form-actions {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-form .btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.auth-form .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Account page styles */
.account-main {
    padding: 2rem;
    flex: 1;
    background: #f8f9fa;
}

.account-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.account-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.account-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.account-content {
    padding: 2rem;
}

.account-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
}

.account-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.account-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.account-form .form-group {
    margin-bottom: 1rem;
}

.account-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.account-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.account-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.account-form input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.account-form small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.account-form .form-actions {
    margin-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.account-form .btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-form .btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.account-form .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Account info styles */
.account-info {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.info-item label {
    font-weight: 500;
    color: #333;
    margin: 0;
}

.info-item span {
    color: #666;
}

.status-active {
    color: #28a745 !important;
    font-weight: 500;
}

.status-inactive {
    color: #dc3545 !important;
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 768px) {
    .auth-container {
        margin: 0 !important;
        align-self: center;
        justify-content: center;
    }
    .auth-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    .auth-buttons .auth-btn {
        width: auto;
        justify-content: center;
        margin: 0 auto;
    }
    
    .auth-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    /* Keep login button full size on small screens */
    .auth-btn.login-btn {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
        width: 170px;
    }
    
    .user-menu-toggle {
        padding: 0.6rem 0.8rem;
        min-height: 40px;
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        border: 1.5px solid rgba(255, 255, 255, 0.3);
        border-radius: 16px;
        box-shadow: 0 3px 12px rgba(40, 167, 69, 0.25);
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .user-dropdown {
        position: absolute;
        left: 50% !important;
        right: auto !important;
        top: calc(100% + 0.5rem) !important; /* immediately below toggle */
        margin-top: 0 !important;
        transform: translateX(-50%) translateY(-10px);
        min-width: 240px;
        max-width: calc(100vw - 2rem);
        width: auto;
    }

    .user-dropdown.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .auth-main {
        padding: 1rem;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
    
    .auth-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .account-main {
        padding: 1rem;
    }
    
    .account-content {
        padding: 1.5rem;
    }
    
    .account-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

    .user-dropdown {
        position: absolute;
        top: calc(100% + 0.5rem) !important; /* immediately below toggle */
        left: 50% !important;
        right: auto !important;
        min-width: 240px;
        max-width: calc(100vw - 2rem);
        width: auto;
        transform: translateX(-50%) translateY(-10px);
    }

    .user-dropdown.show {
        transform: translateX(-50%) translateY(0);
    }
}

.auth-alert {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}